From 969b0dd5da412fed5c71e0af7a4878b03f4c8448 Mon Sep 17 00:00:00 2001 From: Barma-lej <34010886+Barma-lej@users.noreply.github.com> Date: Thu, 31 Oct 2024 23:30:02 +0100 Subject: [PATCH] Update worktime_total sensor Update unit_of_measurement and device_class of worktime_total sensor --- custom_components/landroid_cloud/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/landroid_cloud/sensor.py b/custom_components/landroid_cloud/sensor.py index 7b4f61e..b08cdea 100644 --- a/custom_components/landroid_cloud/sensor.py +++ b/custom_components/landroid_cloud/sensor.py @@ -218,9 +218,9 @@ name="Total Worktime", entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.MEASUREMENT, - device_class=None, + device_class=SensorDeviceClass.DURATION, entity_registry_enabled_default=True, - native_unit_of_measurement="hours", + native_unit_of_measurement="h", suggested_display_precision=0, value_fn=lambda landroid: ( round(landroid.statistics["worktime_total"] / 60, 2)