mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 23:57:06 +00:00
Use OptionsFlowWithReload in honeywell (#149162)
This commit is contained in:
parent
c22f65bd87
commit
94d077ea41
@ -83,18 +83,9 @@ async def async_setup_entry(
|
|||||||
config_entry.runtime_data = HoneywellData(config_entry.entry_id, client, devices)
|
config_entry.runtime_data = HoneywellData(config_entry.entry_id, client, devices)
|
||||||
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
|
||||||
|
|
||||||
config_entry.async_on_unload(config_entry.add_update_listener(update_listener))
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def update_listener(
|
|
||||||
hass: HomeAssistant, config_entry: HoneywellConfigEntry
|
|
||||||
) -> None:
|
|
||||||
"""Update listener."""
|
|
||||||
await hass.config_entries.async_reload(config_entry.entry_id)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(
|
async def async_unload_entry(
|
||||||
hass: HomeAssistant, config_entry: HoneywellConfigEntry
|
hass: HomeAssistant, config_entry: HoneywellConfigEntry
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import (
|
|||||||
ConfigEntry,
|
ConfigEntry,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlow,
|
OptionsFlowWithReload,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -136,7 +136,7 @@ class HoneywellConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return HoneywellOptionsFlowHandler()
|
return HoneywellOptionsFlowHandler()
|
||||||
|
|
||||||
|
|
||||||
class HoneywellOptionsFlowHandler(OptionsFlow):
|
class HoneywellOptionsFlowHandler(OptionsFlowWithReload):
|
||||||
"""Config flow options for Honeywell."""
|
"""Config flow options for Honeywell."""
|
||||||
|
|
||||||
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
async def async_step_init(self, user_input=None) -> ConfigFlowResult:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user