From 2bc41f43c5af23f500590569d9f75815be78b5d9 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Sun, 6 Mar 2022 13:44:19 +0100 Subject: [PATCH] Fix sensor declaration --- custom_components/georide/sensor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/georide/sensor.py b/custom_components/georide/sensor.py index 2ed3032..1ad10a8 100644 --- a/custom_components/georide/sensor.py +++ b/custom_components/georide/sensor.py @@ -31,8 +31,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities): # pylint: d hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.tracker.tracker_id] = coordinator entities.append(GeoRideOdometerSensorEntity(coordinator, tracker_device, hass)) entities.append(GeoRideOdometerKmSensorEntity(coordinator, tracker_device, hass)) + entities.append(GeoRideSpeedSensorEntity(coordinator, tracker_device,hass)) entities.append(GeoRideFixtimeSensorEntity(coordinator, tracker_device)) - entities.append(GeoRideSpeedSensorEntity(coordinator, tracker_device)) if tracker_device.tracker.version > 2: entities.append(GeoRideInternalBatterySensorEntity(coordinator, tracker_device)) entities.append(GeoRideExternalBatterySensorEntity(coordinator, tracker_device)) @@ -317,7 +317,6 @@ class GeoRideFixtimeSensorEntity(CoordinatorEntity, SensorEntity): self._tracker_device = tracker_device self._name = tracker_device.tracker.tracker_name self.entity_id = f"{ENTITY_ID_FORMAT.format('fixtime')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301 - self._state = 0 self._device_class = "timestamp"