mirror of
https://github.com/home-assistant/core.git
synced 2025-09-12 08:11:38 +02:00
Remove rounding of Waze duration sensor (#150424)
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user