Use OptionsFlowWithReload in isy994 (#149174)

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

View File

@ -171,7 +171,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: IsyConfigEntry) -> bool:
_LOGGER.debug("ISY Starting Event Stream and automatic updates") _LOGGER.debug("ISY Starting Event Stream and automatic updates")
isy.websocket.start() isy.websocket.start()
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
entry.async_on_unload( entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update) hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update)
) )
@ -179,11 +178,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: IsyConfigEntry) -> bool:
return True return True
async def _async_update_listener(hass: HomeAssistant, entry: IsyConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)
@callback @callback
def _async_get_or_create_isy_device_in_registry( def _async_get_or_create_isy_device_in_registry(
hass: HomeAssistant, entry: IsyConfigEntry, isy: ISY hass: HomeAssistant, entry: IsyConfigEntry, isy: ISY

View File

@ -18,7 +18,7 @@ from homeassistant.config_entries import (
SOURCE_IGNORE, SOURCE_IGNORE,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlowWithReload,
) )
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -143,7 +143,7 @@ class Isy994ConfigFlow(ConfigFlow, domain=DOMAIN):
@callback @callback
def async_get_options_flow( def async_get_options_flow(
config_entry: IsyConfigEntry, config_entry: IsyConfigEntry,
) -> OptionsFlow: ) -> OptionsFlowHandler:
"""Get the options flow for this handler.""" """Get the options flow for this handler."""
return OptionsFlowHandler() return OptionsFlowHandler()
@ -316,7 +316,7 @@ class Isy994ConfigFlow(ConfigFlow, domain=DOMAIN):
) )
class OptionsFlowHandler(OptionsFlow): class OptionsFlowHandler(OptionsFlowWithReload):
"""Handle a option flow for ISY/IoX.""" """Handle a option flow for ISY/IoX."""
async def async_step_init( async def async_step_init(