Remember state of MQTT availability topics when reconfiguring (#55199)
This commit is contained in:
parent
ebe48e78b7
commit
3432efddaa
1 changed files with 4 additions and 1 deletions
|
@ -330,7 +330,10 @@ class MqttAvailability(Entity):
|
|||
|
||||
self.async_write_ha_state()
|
||||
|
||||
self._available = {topic: False for topic in self._avail_topics}
|
||||
self._available = {
|
||||
topic: (self._available[topic] if topic in self._available else False)
|
||||
for topic in self._avail_topics
|
||||
}
|
||||
topics = {
|
||||
f"availability_{topic}": {
|
||||
"topic": topic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue