Add unique id to lutron caseta config entry when missing (#66346)

This commit is contained in:
J. Nick Koston 2022-02-11 15:19:57 -06:00 committed by GitHub
parent 24418417fd
commit 43d57e7ae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,6 +138,11 @@ async def async_setup_entry(
devices = bridge.get_devices()
bridge_device = devices[BRIDGE_DEVICE_ID]
if not config_entry.unique_id:
hass.config_entries.async_update_entry(
config_entry, unique_id=hex(bridge_device["serial"])[2:].zfill(8)
)
buttons = bridge.buttons
_async_register_bridge_device(hass, entry_id, bridge_device)
button_devices = _async_register_button_devices(