Fix MQTT availability startup race (#37718)

pull/37725/head
Erik Montnemery 2020-07-10 18:40:15 +02:00 committed by GitHub
parent 383db60dff
commit b187b17a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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):