Skip to content

Commit

Permalink
Move up setup of service to make it more robust when running multiple…
Browse files Browse the repository at this point in the history
… instances of deCONZ (#77621)
  • Loading branch information
Kane610 authored Sep 2, 2022
1 parent 8eaadc0 commit 6b361b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/deconz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
except AuthenticationRequired as err:
raise ConfigEntryAuthFailed from err

if not hass.data[DOMAIN]:
async_setup_services(hass)

gateway = hass.data[DOMAIN][config_entry.entry_id] = DeconzGateway(
hass, config_entry, api
)
Expand All @@ -53,9 +56,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
await async_setup_events(gateway)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

if len(hass.data[DOMAIN]) == 1:
async_setup_services(hass)

api.start()

config_entry.async_on_unload(
Expand Down

0 comments on commit 6b361b7

Please sign in to comment.