mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-30 04:24:28 +02:00
prevent crash when using old unique_id #24
This commit is contained in:
parent
6d2dbe8fb0
commit
b3e26c5eb9
1 changed files with 1 additions and 2 deletions
|
@ -618,7 +618,6 @@ class MikrotikControllerData:
|
|||
# ---------------------------
|
||||
# get_queue
|
||||
# ---------------------------
|
||||
|
||||
def get_queue(self):
|
||||
"""Get Queue data from Mikrotik"""
|
||||
self.data["queue"] = parse_api(
|
||||
|
@ -781,7 +780,7 @@ class MikrotikControllerData:
|
|||
for entity in registry.entities.values():
|
||||
if entity.config_entry_id == self.config_entry.entry_id \
|
||||
and entity.domain == DEVICE_TRACKER_DOMAIN \
|
||||
and "-" in entity.unique_id:
|
||||
and "-host-" in entity.unique_id:
|
||||
_, tracker_id, mac = entity.unique_id.split("-", 3)
|
||||
if tracker_id == "host":
|
||||
self.data["host_hass"][mac] = entity.original_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue