mqttdpms: Retain online availability message
Some checks failed
dustin/mqttdpms/pipeline/head There was a failure building this commit
Some checks failed
dustin/mqttdpms/pipeline/head There was a failure building this commit
The *online* message sent to the availability topic needs to have the retained flag set. Without it, when Home Assistant restarts, it will receive the retained *offline* message and mark the entity as unavailable.
This commit is contained in:
@@ -170,7 +170,7 @@ impl MqttDpms {
|
||||
.topics
|
||||
.availability
|
||||
.replace("@UNIQUEID@", &self.config.unique_id);
|
||||
let message = mqtt::Message::new(topic, "online", 0);
|
||||
let message = mqtt::Message::new_retained(topic, "online", 0);
|
||||
Ok(client.publish(message).await?)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user