mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Use OptionsFlowWithReload in sonarr (#149166)
This commit is contained in:
parent
af0480f2a4
commit
54fa4d635b
@ -65,7 +65,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
host_configuration=host_configuration,
|
||||
session=async_get_clientsession(hass),
|
||||
)
|
||||
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
|
||||
coordinators: dict[str, SonarrDataUpdateCoordinator[Any]] = {
|
||||
"upcoming": CalendarDataUpdateCoordinator(
|
||||
hass, entry, host_configuration, sonarr
|
||||
@ -126,8 +125,3 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
hass.data[DOMAIN].pop(entry.entry_id)
|
||||
|
||||
return unload_ok
|
||||
|
||||
|
||||
async def _async_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Handle options update."""
|
||||
await hass.config_entries.async_reload(entry.entry_id)
|
||||
|
@ -17,7 +17,7 @@ from homeassistant.config_entries import (
|
||||
ConfigEntry,
|
||||
ConfigFlow,
|
||||
ConfigFlowResult,
|
||||
OptionsFlow,
|
||||
OptionsFlowWithReload,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_URL, CONF_VERIFY_SSL
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
@ -152,7 +152,7 @@ class SonarrConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
return data_schema
|
||||
|
||||
|
||||
class SonarrOptionsFlowHandler(OptionsFlow):
|
||||
class SonarrOptionsFlowHandler(OptionsFlowWithReload):
|
||||
"""Handle Sonarr client options."""
|
||||
|
||||
async def async_step_init(
|
||||
|
Loading…
x
Reference in New Issue
Block a user