mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Use OptionsFlowWithReload in fritzbox_callmonitor (#149071)
This commit is contained in:
parent
290f19dbd9
commit
12193587c9
@ -48,7 +48,6 @@ async def async_setup_entry(
|
|||||||
raise ConfigEntryNotReady from ex
|
raise ConfigEntryNotReady from ex
|
||||||
|
|
||||||
config_entry.runtime_data = fritzbox_phonebook
|
config_entry.runtime_data = fritzbox_phonebook
|
||||||
config_entry.async_on_unload(config_entry.add_update_listener(update_listener))
|
|
||||||
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
@ -59,10 +58,3 @@ async def async_unload_entry(
|
|||||||
) -> bool:
|
) -> bool:
|
||||||
"""Unloading the fritzbox_callmonitor platforms."""
|
"""Unloading the fritzbox_callmonitor platforms."""
|
||||||
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
|
||||||
|
|
||||||
|
|
||||||
async def update_listener(
|
|
||||||
hass: HomeAssistant, config_entry: FritzBoxCallMonitorConfigEntry
|
|
||||||
) -> None:
|
|
||||||
"""Update listener to reload after option has changed."""
|
|
||||||
await hass.config_entries.async_reload(config_entry.entry_id)
|
|
||||||
|
@ -15,7 +15,7 @@ from homeassistant.config_entries import (
|
|||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlowWithReload,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -263,7 +263,7 @@ class FritzBoxCallMonitorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_abort(reason="reauth_successful")
|
return self.async_abort(reason="reauth_successful")
|
||||||
|
|
||||||
|
|
||||||
class FritzBoxCallMonitorOptionsFlowHandler(OptionsFlow):
|
class FritzBoxCallMonitorOptionsFlowHandler(OptionsFlowWithReload):
|
||||||
"""Handle a fritzbox_callmonitor options flow."""
|
"""Handle a fritzbox_callmonitor options flow."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user