Use OptionsFlowWithReload in met (#149115)

This commit is contained in:
G Johansson 2025-07-20 13:07:46 +02:00 committed by GitHub
parent 1b8f3348b0
commit b31e17f1f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View File

@ -47,7 +47,6 @@ async def async_setup_entry(
config_entry.runtime_data = coordinator
config_entry.async_on_unload(config_entry.add_update_listener(async_update_entry))
config_entry.async_on_unload(coordinator.untrack_home)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
@ -64,11 +63,6 @@ async def async_unload_entry(
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
async def async_update_entry(hass: HomeAssistant, config_entry: MetWeatherConfigEntry):
"""Reload Met component when options changed."""
await hass.config_entries.async_reload(config_entry.entry_id)
async def cleanup_old_device(hass: HomeAssistant) -> None:
"""Cleanup device without proper device identifier."""
device_reg = dr.async_get(hass)

View File

@ -10,7 +10,7 @@ from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import (
CONF_ELEVATION,
@ -147,7 +147,7 @@ class MetConfigFlowHandler(ConfigFlow, domain=DOMAIN):
return MetOptionsFlowHandler()
class MetOptionsFlowHandler(OptionsFlow):
class MetOptionsFlowHandler(OptionsFlowWithReload):
"""Options flow for Met component."""
async def async_step_init(