mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Use OptionsFlowWithReload in vera (#149055)
This commit is contained in:
parent
22b35030a9
commit
b9d19ffb29
@ -143,7 +143,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription)
|
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription)
|
||||||
)
|
)
|
||||||
|
|
||||||
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -161,11 +160,6 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def _async_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
|
||||||
"""Handle options update."""
|
|
||||||
await hass.config_entries.async_reload(entry.entry_id)
|
|
||||||
|
|
||||||
|
|
||||||
def map_vera_device(
|
def map_vera_device(
|
||||||
vera_device: veraApi.VeraDevice, remap: list[int]
|
vera_device: veraApi.VeraDevice, remap: list[int]
|
||||||
) -> Platform | None:
|
) -> Platform | None:
|
||||||
|
@ -17,7 +17,7 @@ from homeassistant.config_entries import (
|
|||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlowWithReload,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_EXCLUDE, CONF_LIGHTS, CONF_SOURCE
|
from homeassistant.const import CONF_EXCLUDE, CONF_LIGHTS, CONF_SOURCE
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -73,7 +73,7 @@ def options_data(user_input: dict[str, str]) -> dict[str, list[int]]:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class OptionsFlowHandler(OptionsFlow):
|
class OptionsFlowHandler(OptionsFlowWithReload):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
async def async_step_init(
|
async def async_step_init(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user