Merge pull request #3 from weirdtangent/feature/mqtt-protocol-version-support

feat: add support for MQTT v3.1.1 protocol version
pull/106/head
Jeff Culverhouse 4 weeks ago committed by GitHub
commit 407f0aa8fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -31,6 +31,7 @@ It supports the following environment variables - but these are a pain, the conf
- `MQTT_HOST` (optional, default = 'localhost')
- `MQTT_QOS` (optional, default = 0)
- `MQTT_PORT` (optional, default = 1883)
- `MQTT_PROTOCOL` (optional, default = '5') - MQTT protocol version: '3.1.1' or '5'
- `MQTT_TLS_ENABLED` (required if using TLS) - set to `true` to enable
- `MQTT_TLS_CA_CERT` (required if using TLS) - path to the ca certs
- `MQTT_TLS_CERT` (required if using TLS) - path to the private cert

@ -4,6 +4,7 @@ mqtt:
username: mqtt
password: password
qos: 0
protocol_version: "5" # MQTT protocol version: 3.1.1/3 or 5 (with or without quotes, default: 5)
prefix: amcrest2mqtt
discovery_prefix: homeassistant
tls_enabled: False

@ -200,6 +200,7 @@ class HelpersMixin:
"host": str(mqtt.get("host") or os.getenv("MQTT_HOST", "localhost")),
"port": int(str(mqtt.get("port") or os.getenv("MQTT_PORT", 1883))),
"qos": int(str(mqtt.get("qos") or os.getenv("MQTT_QOS", 0))),
"protocol_version": str(mqtt.get("protocol_version") or os.getenv("MQTT_PROTOCOL", "5")),
"username": str(mqtt.get("username") or os.getenv("MQTT_USERNAME", "")),
"password": str(mqtt.get("password") or os.getenv("MQTT_PASSWORD", "")),
"tls_enabled": bool(mqtt.get("tls_enabled") or (os.getenv("MQTT_TLS_ENABLED", "false").lower() == "true")),

@ -464,7 +464,7 @@ sdist = { url = "https://files.pythonhosted.org/packages/93/4b/979db9e44be09f71e
[[package]]
name = "mqtt-helper-graystorm"
version = "0.1.0"
source = { git = "https://github.com/weirdtangent/mqtt-helper.git?branch=main#44eeeb0d2559cfa6ae141c623ecda72502a891e5" }
source = { git = "https://github.com/weirdtangent/mqtt-helper.git?branch=main#58cd02c2c9675830feb5b433aff5b5a517572c56" }
dependencies = [
{ name = "logging" },
{ name = "paho-mqtt" },

Loading…
Cancel
Save