fixed restore from HA device registry when device name contains "-" #24

This commit is contained in:
tomaae 2020-04-10 09:18:09 +02:00
parent 2620ea3761
commit 2c471cc981

View file

@ -868,7 +868,7 @@ class MikrotikControllerData:
if entity.config_entry_id == self.config_entry.entry_id \
and entity.domain == DEVICE_TRACKER_DOMAIN \
and "-host-" in entity.unique_id:
_, _, mac = entity.unique_id.split("-", 3)
_, mac = entity.unique_id.split("-host-", 2)
self.data["host_hass"][mac] = entity.original_name
# ---------------------------