Use OptionsFlowWithReload in vodafone_station

This commit is contained in:
G Johansson
2025-07-20 13:08:19 +00:00
parent e3bdd12dad
commit 7b8dca932e
2 changed files with 6 additions and 10 deletions

View File

@ -25,8 +25,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: VodafoneConfigEntry) ->
entry.runtime_data = coordinator
entry.async_on_unload(entry.add_update_listener(update_listener))
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
@ -39,9 +37,3 @@ async def async_unload_entry(hass: HomeAssistant, entry: VodafoneConfigEntry) ->
await coordinator.api.logout()
return unload_ok
async def update_listener(hass: HomeAssistant, entry: VodafoneConfigEntry) -> None:
"""Update when config_entry options update."""
if entry.options:
await hass.config_entries.async_reload(entry.entry_id)

View File

@ -12,7 +12,11 @@ from homeassistant.components.device_tracker import (
CONF_CONSIDER_HOME,
DEFAULT_CONSIDER_HOME,
)
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
from homeassistant.config_entries import (
ConfigFlow,
ConfigFlowResult,
OptionsFlowWithReload,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
@ -180,7 +184,7 @@ class VodafoneStationConfigFlow(ConfigFlow, domain=DOMAIN):
)
class VodafoneStationOptionsFlowHandler(OptionsFlow):
class VodafoneStationOptionsFlowHandler(OptionsFlowWithReload):
"""Handle a option flow."""
async def async_step_init(