Use OptionsFlowWithReload in Synology DSM (#149086)

This commit is contained in:
Michael
2025-07-19 21:08:37 +02:00
committed by GitHub
parent afbb0ee2f4
commit 96766fc62a
2 changed files with 2 additions and 10 deletions

View File

@ -136,7 +136,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: SynologyDSMConfigEntry)
coordinator_switches=coordinator_switches,
)
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]:
@ -172,13 +171,6 @@ async def async_unload_entry(
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(
hass: HomeAssistant, entry: SynologyDSMConfigEntry, device_entry: dr.DeviceEntry
) -> bool:

View File

@ -24,7 +24,7 @@ from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import (
CONF_DISKS,
@ -441,7 +441,7 @@ class SynologyDSMFlowHandler(ConfigFlow, domain=DOMAIN):
return None
class SynologyDSMOptionsFlowHandler(OptionsFlow):
class SynologyDSMOptionsFlowHandler(OptionsFlowWithReload):
"""Handle a option flow."""
config_entry: SynologyDSMConfigEntry