Skip to content

Commit

Permalink
fix: assign hubitat hass data before use
Browse files Browse the repository at this point in the history
Some of HA's recent performance improvements exposed a race condition in
the integration's initialization code.
  • Loading branch information
jason0x43 committed Apr 27, 2024
1 parent 08c2ac5 commit 15012c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/hubitat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b

hub = Hub(hass, config_entry, len(hass.data[DOMAIN]) + 1)

hass.data[DOMAIN][config_entry.entry_id] = hub

if not await hub.async_setup():
return False

hass.data[DOMAIN][config_entry.entry_id] = hub

hub.async_update_device_registry()

async_register_services(hass, config_entry)
Expand Down

0 comments on commit 15012c7

Please sign in to comment.