Skip to content

Commit d266b6f

Browse files
authored
Use OptionsFlowWithReload in AVM Fritz!Box Tools (home-assistant#149085)
1 parent dbdc666 commit d266b6f

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

homeassistant/components/fritz/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: FritzConfigEntry) -> boo
7575
if FRITZ_DATA_KEY not in hass.data:
7676
hass.data[FRITZ_DATA_KEY] = FritzData()
7777

78-
entry.async_on_unload(entry.add_update_listener(update_listener))
79-
8078
# Load the other platforms like switch
8179
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
8280

@@ -94,9 +92,3 @@ async def async_unload_entry(hass: HomeAssistant, entry: FritzConfigEntry) -> bo
9492
hass.data.pop(FRITZ_DATA_KEY)
9593

9694
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
97-
98-
99-
async def update_listener(hass: HomeAssistant, entry: FritzConfigEntry) -> None:
100-
"""Update when config_entry options update."""
101-
if entry.options:
102-
await hass.config_entries.async_reload(entry.entry_id)

homeassistant/components/fritz/config_flow.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
CONF_CONSIDER_HOME,
1818
DEFAULT_CONSIDER_HOME,
1919
)
20-
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow
20+
from homeassistant.config_entries import (
21+
ConfigFlow,
22+
ConfigFlowResult,
23+
OptionsFlowWithReload,
24+
)
2125
from homeassistant.const import (
2226
CONF_HOST,
2327
CONF_PASSWORD,
@@ -409,7 +413,7 @@ async def async_step_reconfigure(
409413
)
410414

411415

412-
class FritzBoxToolsOptionsFlowHandler(OptionsFlow):
416+
class FritzBoxToolsOptionsFlowHandler(OptionsFlowWithReload):
413417
"""Handle an options flow."""
414418

415419
async def async_step_init(

0 commit comments

Comments
 (0)