From 7a8702d57ce558eb184cc52cd6f91263ea5f0957 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Fri, 4 Mar 2022 19:21:59 +0100 Subject: [PATCH] Fix 'DeviceBeacon' object has no attribute 'tracker_beacon' --- custom_components/georide/binary_sensor.py | 2 +- custom_components/georide/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/georide/binary_sensor.py b/custom_components/georide/binary_sensor.py index e1cca3e..0db7c6b 100644 --- a/custom_components/georide/binary_sensor.py +++ b/custom_components/georide/binary_sensor.py @@ -280,7 +280,7 @@ class GeoRideBeaconUpdatedBinarySensorEntity(GeoRideBeaconBinarySensorEntity): tracker_beacon_device: DeviceBeacon): """Set up Georide entity.""" super().__init__(coordinator, tracker_beacon_device) - self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}.{tracker_beacon_device.tracker_beacon.beacon_id}"# pylint: disable=C0301 + self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}.{tracker_beacon_device.beacon.beacon_id}"# pylint: disable=C0301 @property def unique_id(self): diff --git a/custom_components/georide/sensor.py b/custom_components/georide/sensor.py index 88929d4..3f447d5 100644 --- a/custom_components/georide/sensor.py +++ b/custom_components/georide/sensor.py @@ -41,7 +41,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): # pylint: d tracker_beacon = coordoned_beacon['tracker_beacon'] coordinator = coordoned_beacon['coordinator'] entities.append(GeoRideBeaconBatterySensorEntity(coordinator, tracker_beacon)) - hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.beacon.beacon_id] = coordinator + hass.data[GEORIDE_DOMAIN]["devices"][tracker_beacon.beacon.beacon_id] = coordinator async_add_entities(entities)