mqttdpms: Retain online availability message
dustin/mqttdpms/pipeline/head There was a failure building this commit
Details
dustin/mqttdpms/pipeline/head There was a failure building this commit
Details
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.master
parent
14b6fd0046
commit
250a838b92
|
@ -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?)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue