diff --git a/custom_components/georide/binary_sensor.py b/custom_components/georide/binary_sensor.py index 8bef3dd..e1cca3e 100644 --- a/custom_components/georide/binary_sensor.py +++ b/custom_components/georide/binary_sensor.py @@ -74,7 +74,7 @@ class GeoRideBeaconBinarySensorEntity(CoordinatorEntity, BinarySensorEntity): super().__init__(coordinator) self._tracker_device_beacon = tracker_device_beacon self._name = tracker_device_beacon.beacon.name - self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}.{tracker_device.beacon.beacon_id}"# pylint: disable=C0301 + self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}.{tracker_device_beacon.beacon.beacon_id}"# pylint: disable=C0301 self._is_on = False @property diff --git a/custom_components/georide/sensor.py b/custom_components/georide/sensor.py index 4653637..88929d4 100644 --- a/custom_components/georide/sensor.py +++ b/custom_components/georide/sensor.py @@ -285,11 +285,11 @@ class GeoRideBeaconBatterySensorEntity(CoordinatorEntity, SensorEntity): """Represent a tracked device.""" def __init__(self, coordinator: DataUpdateCoordinator[Mapping[str, Any]], - tracker_beacon:DeviceBeacon): + tracker_beacon: DeviceBeacon): """Set up GeoRide entity.""" super().__init__(coordinator) - self._tracker_device = tracker_device - self._name = tracker_device.tracker.tracker_name + self._tracker_device = tracker_beacon + self._name = tracker_beacon.beacon.name self._unit_of_measurement = "%" self.entity_id = f"{ENTITY_ID_FORMAT.format('battery_percent')}.{tracker_beacon.beacon.beacon_id}"# pylint: disable=C0301 self._state = 0