Handle updating config entries in Vera (#49605)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Greg Dowling 2021-05-26 17:54:02 +01:00 committed by GitHub
parent 22dd7df66c
commit 09b9218511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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."""