Use OptionsFlowWithReload in netgear (#149069)

This commit is contained in:
G Johansson 2025-07-19 16:37:37 +02:00 committed by GitHub
parent 7202203f35
commit 13434012e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -61,8 +61,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data.setdefault(DOMAIN, {}) hass.data.setdefault(DOMAIN, {})
entry.async_on_unload(entry.add_update_listener(update_listener))
async def async_update_devices() -> bool: async def async_update_devices() -> bool:
"""Fetch data from the router.""" """Fetch data from the router."""
if router.track_devices: if router.track_devices:
@ -194,11 +192,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return unload_ok return unload_ok
async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(config_entry.entry_id)
async def async_remove_config_entry_device( async def async_remove_config_entry_device(
hass: HomeAssistant, config_entry: ConfigEntry, device_entry: dr.DeviceEntry hass: HomeAssistant, config_entry: ConfigEntry, device_entry: dr.DeviceEntry
) -> bool: ) -> bool:

View File

@ -13,7 +13,7 @@ from homeassistant.config_entries import (
ConfigEntry, ConfigEntry,
ConfigFlow, ConfigFlow,
ConfigFlowResult, ConfigFlowResult,
OptionsFlow, OptionsFlowWithReload,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST, CONF_HOST,
@ -65,7 +65,7 @@ def _ordered_shared_schema(schema_input):
} }
class OptionsFlowHandler(OptionsFlow): class OptionsFlowHandler(OptionsFlowWithReload):
"""Options for the component.""" """Options for the component."""
async def async_step_init( async def async_step_init(