mqtt_client.py: make auto discovery message retained

This commit is contained in:
coon 2025-09-30 20:39:54 +00:00
parent 14b92ac966
commit f298edbb81

View file

@ -33,7 +33,7 @@ class MqttClient:
}
)
self.client.publish(self.MQTT_DISCOVERY_TOPIC, payload=j, qos=0, retain=False)
self.client.publish(self.MQTT_DISCOVERY_TOPIC, payload=j, qos=0, retain=True)
def on_connect(self, client, userdata, flags, reason_code, properties):
print(f"Connected: {reason_code}")