Make Axis integration use config entry unique id (#30461)
* Make Axis integration use config entry unique id
This commit is contained in:
1 parent
075d3f6e32
commit
63347ebeb5
11 files changed
+87
-133
No files matched your search
@@ -29,6 +29,12 @@ async def async_setup_entry(hass, config_entry):
|
||||
if not await device.async_setup():
|
||||
return False
|
||||
|
||||
# 0.104 introduced config entry unique id, this makes upgrading possible
|
||||
if config_entry.unique_id is None:
|
||||
hass.config_entries.async_update_entry(
|
||||
config_entry, unique_id=device.api.vapix.params.system_serialnumber
|
||||
)
|
||||
|
||||
hass.data[DOMAIN][device.serial] = device
|
||||
|
||||
await device.async_update_device_registry()
|
||||
|
||||
Reference in new issue
Block a user