mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Use OptionsFlowWithReload in Synology DSM (#149086)
This commit is contained in:
parent
afbb0ee2f4
commit
96766fc62a
@ -136,7 +136,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: SynologyDSMConfigEntry)
|
|||||||
coordinator_switches=coordinator_switches,
|
coordinator_switches=coordinator_switches,
|
||||||
)
|
)
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
|
|
||||||
|
|
||||||
if entry.options[CONF_BACKUP_SHARE]:
|
if entry.options[CONF_BACKUP_SHARE]:
|
||||||
|
|
||||||
@ -172,13 +171,6 @@ async def async_unload_entry(
|
|||||||
return unload_ok
|
return unload_ok
|
||||||
|
|
||||||
|
|
||||||
async def _async_update_listener(
|
|
||||||
hass: HomeAssistant, entry: SynologyDSMConfigEntry
|
|
||||||
) -> None:
|
|
||||||
"""Handle options update."""
|
|
||||||
await hass.config_entries.async_reload(entry.entry_id)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_remove_config_entry_device(
|
async def async_remove_config_entry_device(
|
||||||
hass: HomeAssistant, entry: SynologyDSMConfigEntry, device_entry: dr.DeviceEntry
|
hass: HomeAssistant, entry: SynologyDSMConfigEntry, device_entry: dr.DeviceEntry
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
@ -24,7 +24,7 @@ from homeassistant.config_entries import (
|
|||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlowWithReload,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_DISKS,
|
CONF_DISKS,
|
||||||
@ -441,7 +441,7 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
class SynologyDSMOptionsFlowHandler(OptionsFlow):
|
class SynologyDSMOptionsFlowHandler(OptionsFlowWithReload):
|
||||||
"""Handle a option flow."""
|
"""Handle a option flow."""
|
||||||
|
|
||||||
config_entry: SynologyDSMConfigEntry
|
config_entry: SynologyDSMConfigEntry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user