Use OptionsFlowWithReload in yeelight (#149045)

This commit is contained in:
G Johansson 2025-07-19 14:14:13 +02:00 committed by GitHub
parent d7d2013ec8
commit 284b90d502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions

View File

@ -232,9 +232,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
# Wait to install the reload listener until everything was successfully initialized
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
return True
@ -245,11 +242,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def _async_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)
async def _async_get_device(
hass: HomeAssistant, host: str, entry: ConfigEntry
) -> YeelightDevice:

View File

@ -17,7 +17,7 @@ from homeassistant.config_entries import (
ConfigEntryState,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_MODEL, CONF_NAME
from homeassistant.core import callback
@ -298,7 +298,7 @@ class YeelightConfigFlow(ConfigFlow, domain=DOMAIN):
return MODEL_UNKNOWN
class OptionsFlowHandler(OptionsFlow):
class OptionsFlowHandler(OptionsFlowWithReload):
"""Handle a option flow for Yeelight."""
async def async_step_init(