mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 14:54:04 +02:00
fixes
This commit is contained in:
parent
d06d4e706a
commit
297539adda
3 changed files with 3 additions and 12 deletions
|
|
@ -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]()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue