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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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, 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:

View File

@ -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