diff --git a/custom_components/adaptive_lighting/__init__.py b/custom_components/adaptive_lighting/__init__.py index e8257a42..6b5f6c7d 100755 --- a/custom_components/adaptive_lighting/__init__.py +++ b/custom_components/adaptive_lighting/__init__.py @@ -24,7 +24,6 @@ Resources: * The integration does not calculate a true "Blue Hour" -- it just sets the lights to 2700K (warm white) until your hub goes into "Sleep mode". """ -import asyncio import logging import voluptuous as vol @@ -88,13 +87,8 @@ async def async_update_options(hass, config_entry: ConfigEntry): async def async_unload_entry(hass, config_entry: ConfigEntry) -> bool: """Unload a config entry.""" - unload_ok = all( - await asyncio.gather( - *[ - hass.config_entries.async_forward_entry_unload(config_entry, platform) - for platform in PLATFORMS - ] - ) + unload_ok = await hass.config_entries.async_forward_entry_unload( + config_entry, "switch" ) data = hass.data[DOMAIN] data[config_entry.entry_id][UNDO_UPDATE_LISTENER]() diff --git a/custom_components/adaptive_lighting/config_flow.py b/custom_components/adaptive_lighting/config_flow.py index 2b2de991..a0c746a0 100644 --- a/custom_components/adaptive_lighting/config_flow.py +++ b/custom_components/adaptive_lighting/config_flow.py @@ -45,9 +45,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): await self.async_set_unique_id(user_input["name"]) for entry in self._async_current_entries(): if entry.unique_id == self.unique_id: - self.hass.config_entries.async_update_entry( - entry, data=dict(entry.data, **user_input) - ) + self.hass.config_entries.async_update_entry(entry, data=user_input) self._abort_if_unique_id_configured() return self.async_create_entry(title=user_input["name"], data=user_input) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 56614c2d..47d892ff 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -317,7 +317,6 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): self.unsub_trackers.extend([rm_from, rm_to]) def _unsub_trackers(self): - assert self.unsub_trackers while self.unsub_trackers: unsub = self.unsub_trackers.pop() unsub()