mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Use OptionsFlowWithReload in hyperion (#149163)
This commit is contained in:
parent
54fa4d635b
commit
671523feb3
@ -266,16 +266,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: HyperionConfigEntry) ->
|
|||||||
assert hyperion_client
|
assert hyperion_client
|
||||||
if hyperion_client.instances is not None:
|
if hyperion_client.instances is not None:
|
||||||
await async_instances_to_clients_raw(hyperion_client.instances)
|
await async_instances_to_clients_raw(hyperion_client.instances)
|
||||||
entry.async_on_unload(entry.add_update_listener(_async_entry_updated))
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def _async_entry_updated(hass: HomeAssistant, entry: HyperionConfigEntry) -> None:
|
|
||||||
"""Handle entry updates."""
|
|
||||||
await hass.config_entries.async_reload(entry.entry_id)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistant, entry: HyperionConfigEntry) -> bool:
|
async def async_unload_entry(hass: HomeAssistant, entry: HyperionConfigEntry) -> bool:
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
@ -17,7 +17,7 @@ from homeassistant.config_entries import (
|
|||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlowWithReload,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_BASE,
|
CONF_BASE,
|
||||||
@ -431,7 +431,7 @@ class HyperionConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return HyperionOptionsFlow()
|
return HyperionOptionsFlow()
|
||||||
|
|
||||||
|
|
||||||
class HyperionOptionsFlow(OptionsFlow):
|
class HyperionOptionsFlow(OptionsFlowWithReload):
|
||||||
"""Hyperion options flow."""
|
"""Hyperion options flow."""
|
||||||
|
|
||||||
def _create_client(self) -> client.HyperionClient:
|
def _create_client(self) -> client.HyperionClient:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user