From 9e290f27ee744faddd5dd2e81bdf52f09e8ba790 Mon Sep 17 00:00:00 2001 From: Jeroen Hof <32430809+Metal-Eagle@users.noreply.github.com> Date: Sat, 25 Jul 2026 05:24:10 +0200 Subject: [PATCH] refactor: update sensor descriptions for completion time and delay start --- .../localthings/registry/capabilities/operational.py | 5 ++--- custom_components/localthings/translations/en.json | 3 +++ custom_components/localthings/translations/nl.json | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/custom_components/localthings/registry/capabilities/operational.py b/custom_components/localthings/registry/capabilities/operational.py index dbee0dd..6970140 100644 --- a/custom_components/localthings/registry/capabilities/operational.py +++ b/custom_components/localthings/registry/capabilities/operational.py @@ -156,16 +156,15 @@ OPERATIONAL_STATE = Capability( # firmware leaves a stale remainingTime after a cycle ends, and # freezes it at '00:01:00' when progress reaches 'Finish'. SensorDesc(key='finish_time', device_class='timestamp', - name='Estimated finish', rep_fn=_finish_time), - SensorDesc(key='completion_minutes', name='Remaining minutes', + SensorDesc(key='completion_minutes', icon='mdi:clock-outline', unit='min', device_class='duration', state_class='measurement', exists_fn=lambda rep, resources: _completion_minutes(rep) is not None, rep_fn=_completion_minutes), - NumberDesc(key='delay_start_hours', name='Delay start', icon='mdi:timer-plus-outline', + NumberDesc(key='delay_start_hours', icon='mdi:timer-plus-outline', device_class='duration', unit='h', native_min=0, native_max=24, step=1, rep_fn=lambda rep: _delay_hours( diff --git a/custom_components/localthings/translations/en.json b/custom_components/localthings/translations/en.json index f7e93bc..b224bfd 100644 --- a/custom_components/localthings/translations/en.json +++ b/custom_components/localthings/translations/en.json @@ -511,6 +511,9 @@ "finish_time": { "name": "Estimated finish" }, + "completion_minutes": { + "name": "Estimated finish (minutes)" + }, "freezer_temperature": { "name": "Freezer temperature" }, diff --git a/custom_components/localthings/translations/nl.json b/custom_components/localthings/translations/nl.json index b008764..0272f1b 100644 --- a/custom_components/localthings/translations/nl.json +++ b/custom_components/localthings/translations/nl.json @@ -511,6 +511,9 @@ "finish_time": { "name": "Geschatte eindtijd" }, + "completion_minutes": { + "name": "Geschatte eindtijd (minuten)" + }, "freezer_temperature": { "name": "Vriezertemperatuur" },