Fix MQTT availability startup race (#37718)

This commit is contained in:
Erik Montnemery authored and GitHub committed 2020-07-10 09:40:15 -07:00
1 parent 383db60dff
commit b187b17a4f
1 file changed
+1 -1
+1 -1
View File
@@ -1107,7 +1107,7 @@ class MqttAvailability(Entity):
@callback
def async_mqtt_connect(self):
"""Update state on connection/disconnection to MQTT broker."""
if self.hass.is_running:
if not self.hass.is_stopping:
self.async_write_ha_state()
async def async_will_remove_from_hass(self):