Use OptionsFlowWithReload in wiffi (#149053)

This commit is contained in:
G Johansson 2025-07-19 16:48:53 +02:00 committed by GitHub
parent b9d19ffb29
commit 1bbd07fe48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -29,8 +29,6 @@ PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up wiffi from a config entry, config_entry contains data from config entry database."""
if not entry.update_listeners:
entry.add_update_listener(async_update_options)
# create api object
api = WiffiIntegrationApi(hass)
@ -53,11 +51,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_update_options(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update options."""
await hass.config_entries.async_reload(entry.entry_id)
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
api: WiffiIntegrationApi = hass.data[DOMAIN][entry.entry_id]

View File

@ -15,7 +15,7 @@ from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
OptionsFlowWithReload,
)
from homeassistant.const import CONF_PORT, CONF_TIMEOUT
from homeassistant.core import callback
@ -76,7 +76,7 @@ class WiffiFlowHandler(ConfigFlow, domain=DOMAIN):
)
class OptionsFlowHandler(OptionsFlow):
class OptionsFlowHandler(OptionsFlowWithReload):
"""Wiffi server setup option flow."""
async def async_step_init(