diff --git a/custom_components/gyverlamp/__init__.py b/custom_components/gyverlamp/__init__.py index d84a71f..64467dd 100644 --- a/custom_components/gyverlamp/__init__.py +++ b/custom_components/gyverlamp/__init__.py @@ -25,9 +25,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): return True -async def async_update_options(hass: HomeAssistant, entry: ConfigEntry): - # update entity config - hass.data[DOMAIN][entry.entry_id].update_config(entry.options) +async def async_update_options(hass: HomeAssistant, config_entry: ConfigEntry): + await hass.config_entries.async_reload(config_entry.entry_id) async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): diff --git a/custom_components/gyverlamp/light.py b/custom_components/gyverlamp/light.py index 6aa62c0..c1e6471 100644 --- a/custom_components/gyverlamp/light.py +++ b/custom_components/gyverlamp/light.py @@ -63,11 +63,6 @@ async def async_setup_entry( hass.data[DOMAIN][entry.entry_id] = entity -async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): - hass.data[DOMAIN].pop(entry.entry_id) - return True - - class GyverLamp(LightEntity): def __init__(self, config: dict, unique_id=None): self._attr_effect_list = config.get(CONF_EFFECTS, EFFECTS)