Handle updating config entries in Vera (#49605)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
22dd7df66c
commit
09b9218511
1 changed files with 8 additions and 0 deletions
|
@ -159,6 +159,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription)
|
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_subscription)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config_entry.async_on_unload(
|
||||||
|
config_entry.add_update_listener(_async_update_listener)
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,6 +179,11 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
async def _async_update_listener(hass: HomeAssistant, entry: ConfigEntry):
|
||||||
|
"""Handle options update."""
|
||||||
|
await hass.config_entries.async_reload(entry.entry_id)
|
||||||
|
|
||||||
|
|
||||||
def map_vera_device(vera_device: veraApi.VeraDevice, remap: list[int]) -> str:
|
def map_vera_device(vera_device: veraApi.VeraDevice, remap: list[int]) -> str:
|
||||||
"""Map vera classes to Home Assistant types."""
|
"""Map vera classes to Home Assistant types."""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue