Use OptionsFlowWithReload in ws66i (#149052)

This commit is contained in:
G Johansson 2025-07-19 16:49:19 +02:00 committed by GitHub
parent 1bbd07fe48
commit 4a5e193ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View File

@ -100,7 +100,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Close the WS66i connection to the amplifier."""
ws66i.close()
entry.async_on_unload(entry.add_update_listener(_update_listener))
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, shutdown)
)
@ -119,8 +118,3 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
async def _update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)

View File

@ -12,7 +12,7 @@ from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import CONF_IP_ADDRESS
from homeassistant.core import HomeAssistant, callback
@ -142,7 +142,7 @@ def _key_for_source(
)
class Ws66iOptionsFlowHandler(OptionsFlow):
class Ws66iOptionsFlowHandler(OptionsFlowWithReload):
"""Handle a WS66i options flow."""
async def async_step_init(