mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 12:38:21 +00:00
Copy device identifer to string
This commit is contained in:
parent
b21f69ab7b
commit
e04bb5932d
@ -156,7 +156,7 @@ def remove_stale_devices(
|
|||||||
device_entries = dr.async_entries_for_config_entry(
|
device_entries = dr.async_entries_for_config_entry(
|
||||||
device_registry, config_entry.entry_id
|
device_registry, config_entry.entry_id
|
||||||
)
|
)
|
||||||
all_device_ids = {device.id for device in devices}
|
all_device_ids = {str(device.id) for device in devices}
|
||||||
|
|
||||||
for device_entry in device_entries:
|
for device_entry in device_entries:
|
||||||
device_id: str | None = None
|
device_id: str | None = None
|
||||||
@ -166,7 +166,9 @@ def remove_stale_devices(
|
|||||||
if identifier[0] != DOMAIN:
|
if identifier[0] != DOMAIN:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
_id = identifier[1]
|
# The device id in the identifier is not copied from integer to string
|
||||||
|
# when setting entity device info. Copy here to make sure it's a string.
|
||||||
|
_id = str(identifier[1])
|
||||||
|
|
||||||
# Identify gateway device.
|
# Identify gateway device.
|
||||||
if _id == config_entry.data[CONF_GATEWAY_ID]:
|
if _id == config_entry.data[CONF_GATEWAY_ID]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user