diff --git a/custom_components/georide/device.py b/custom_components/georide/device.py index 0bf04fb..a7276c4 100644 --- a/custom_components/georide/device.py +++ b/custom_components/georide/device.py @@ -54,7 +54,7 @@ class Device: @property def unique_id(self) -> str: """Get the unique id.""" - return f"{GEORIDE_DOMAIN}_{self._tracker.tracker_id}" + return {(GEORIDE_DOMAIN, self._tracker.tracker_id)} def __str__(self) -> str: """Get string representation.""" @@ -103,7 +103,7 @@ class DeviceBeacon: def unique_id(self) -> str: """Get the unique id.""" - return f"{GEORIDE_DOMAIN}_beacon_{self._tracker.tracker_id}" + return {(GEORIDE_DOMAIN, self._beacon.beacon_id)} def __str__(self) -> str: """Get string representation.""" diff --git a/custom_components/georide/siren.py b/custom_components/georide/siren.py index dd72704..d507210 100644 --- a/custom_components/georide/siren.py +++ b/custom_components/georide/siren.py @@ -17,7 +17,7 @@ import georideapilib.api as GeoRideApi from .const import DOMAIN as GEORIDE_DOMAIN from .device import Device -ENTITY_ID_FORMAT: Final = GEORIDE_DOMAIN + ".{}" +ENTITY_ID_FORMAT = GEORIDE_DOMAIN + ".{}" _LOGGER = logging.getLogger(__name__) @@ -31,7 +31,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): # pylint: d for coordoned_tracker in coordoned_trackers: tracker_device = coordoned_tracker['tracker_device'] coordinator = coordoned_tracker['coordinator'] - hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.unique_id] = coordinator + hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.tracker.tracker_id] = coordinator if tracker_device.tracker.version > 2: entities.append(GeoRideSirenEntity(coordinator, tracker_device, hass))