mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Remember state of MQTT availability topics when reconfiguring (#55199)
This commit is contained in:
parent
ebe48e78b7
commit
3432efddaa
@ -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…
x
Reference in New Issue
Block a user