diff --git a/CHANGELOG.md b/CHANGELOG.md index 491275a..c128207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). - upgrade homeassistant to 2024.3.3 +### Fixed + +- warnings about invalid suggested_unit_of_measurement + ## [0.1.0] - 2024-03-29 ### Added diff --git a/custom_components/king_smith/sensor.py b/custom_components/king_smith/sensor.py index 1ff8a74..b1944aa 100644 --- a/custom_components/king_smith/sensor.py +++ b/custom_components/king_smith/sensor.py @@ -38,7 +38,6 @@ class WalkingPadSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=UnitOfLength.KILOMETERS, state_class=SensorStateClass.TOTAL_INCREASING, suggested_display_precision=2, - suggested_unit_of_measurement=UnitOfLength.KILOMETERS, translation_key="walkingpad_distance", value_fn=lambda status: status.get("session_distance", 0.0) / 1000, ), @@ -59,7 +58,6 @@ class WalkingPadSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=UnitOfTime.MINUTES, state_class=SensorStateClass.TOTAL_INCREASING, suggested_display_precision=0, - suggested_unit_of_measurement=UnitOfTime.MINUTES, translation_key="walkingpad_duration_minutes", value_fn=lambda status: round(status.get("session_running_time", 0) / 60, 1), ), @@ -70,7 +68,6 @@ class WalkingPadSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=UnitOfTime.HOURS, state_class=SensorStateClass.TOTAL_INCREASING, suggested_display_precision=1, - suggested_unit_of_measurement=UnitOfTime.HOURS, translation_key="walkingpad_duration_hours", value_fn=lambda status: round(status.get("session_running_time", 0) / 3600, 4), ), @@ -81,7 +78,6 @@ class WalkingPadSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=UnitOfTime.DAYS, state_class=SensorStateClass.TOTAL_INCREASING, suggested_display_precision=1, - suggested_unit_of_measurement=UnitOfTime.DAYS, translation_key="walkingpad_duration_days", value_fn=lambda status: round(status.get("session_running_time", 0) / 86400, 6), ), @@ -93,7 +89,6 @@ class WalkingPadSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=1, - suggested_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR, translation_key="walkingpad_current_speed", value_fn=lambda status: status.get("speed", 0.0), ),