Skip to content

Commit

Permalink
Fix excepiton on unload domain
Browse files Browse the repository at this point in the history
Fix for #435
  • Loading branch information
shammysha committed Feb 3, 2024
1 parent a8b67d8 commit 4d6824d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions custom_components/yandex_station/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ async def update_cookie_and_token(**kwargs):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
quasar: YandexQuasar = hass.data[DOMAIN][entry.unique_id]
quasar.stop()
return await hass.config_entries.async_unload_platforms(
entry, MAIN_DOMAINS + SUB_DOMAINS
)

domains = MAIN_DOMAINS
if CONF_INCLUDE in hass.data[DOMAIN][DATA_CONFIG]:
domains += SUB_DOMAINS

return await hass.config_entries.async_unload_platforms(entry, domains)


async def _init_local_discovery(hass: HomeAssistant):
Expand Down

0 comments on commit 4d6824d

Please sign in to comment.