This commit is contained in:
Bas Nijholt 2020-09-29 13:13:08 +02:00
commit 297539adda
3 changed files with 3 additions and 12 deletions

View file

@ -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]()

View file

@ -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)

View file

@ -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()