Skip to content

Commit

Permalink
Fix MQTT availability startup race (#37718)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored and balloob committed Jul 14, 2020
1 parent 114fbb1 commit 502f0cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/__init__.py
Expand Up @@ -1083,7 +1083,7 @@ def availability_message_received(msg: Message) -> None:
@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):
Expand Down

0 comments on commit 502f0cd

Please sign in to comment.