mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Use OptionsFlowWithReload in wiffi (#149053)
This commit is contained in:
parent
b9d19ffb29
commit
1bbd07fe48
@ -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]
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user