Use OptionsFlowWithReload in keenetic_ndms2 (#149173)

This commit is contained in:
G Johansson 2025-07-21 12:47:11 +02:00 committed by GitHub
parent 8c964e64db
commit 0dba32dbcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -33,8 +33,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: KeeneticConfigEntry) ->
router = KeeneticRouter(hass, entry)
await router.async_setup()
entry.async_on_unload(entry.add_update_listener(update_listener))
entry.runtime_data = router
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@ -87,11 +85,6 @@ async def async_unload_entry(
return unload_ok
async def update_listener(hass: HomeAssistant, entry: KeeneticConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)
def async_add_defaults(hass: HomeAssistant, entry: KeeneticConfigEntry):
"""Populate default options."""
host: str = entry.data[CONF_HOST]

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
SOURCE_RECONFIGURE,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import (
CONF_HOST,
@ -153,7 +153,7 @@ class KeeneticFlowHandler(ConfigFlow, domain=DOMAIN):
return await self.async_step_user()
class KeeneticOptionsFlowHandler(OptionsFlow):
class KeeneticOptionsFlowHandler(OptionsFlowWithReload):
"""Handle options."""
config_entry: KeeneticConfigEntry