Remove rounding of Waze duration sensor (#150424)

This commit is contained in:
Etienne C.
2025-08-12 12:20:48 +02:00
committed by GitHub
parent 8edbcc92d3
commit 313b5a483c

View File

@@ -39,6 +39,7 @@ class WazeTravelTimeSensor(CoordinatorEntity[WazeTravelTimeCoordinator], SensorE
_attr_attribution = "Powered by Waze" _attr_attribution = "Powered by Waze"
_attr_native_unit_of_measurement = UnitOfTime.MINUTES _attr_native_unit_of_measurement = UnitOfTime.MINUTES
_attr_suggested_display_precision = 0
_attr_device_class = SensorDeviceClass.DURATION _attr_device_class = SensorDeviceClass.DURATION
_attr_state_class = SensorStateClass.MEASUREMENT _attr_state_class = SensorStateClass.MEASUREMENT
_attr_device_info = DeviceInfo( _attr_device_info = DeviceInfo(
@@ -63,11 +64,8 @@ class WazeTravelTimeSensor(CoordinatorEntity[WazeTravelTimeCoordinator], SensorE
@property @property
def native_value(self) -> float | None: def native_value(self) -> float | None:
"""Return the state of the sensor.""" """Return the state of the sensor."""
if ( if self.coordinator.data is not None:
self.coordinator.data is not None return self.coordinator.data.duration
and self.coordinator.data.duration is not None
):
return round(self.coordinator.data.duration)
return None return None
@property @property