diff --git a/custom_components/localthings/registry/capabilities/operational.py b/custom_components/localthings/registry/capabilities/operational.py index 27bf209..8494e6c 100644 --- a/custom_components/localthings/registry/capabilities/operational.py +++ b/custom_components/localthings/registry/capabilities/operational.py @@ -75,7 +75,7 @@ def _delay_hours(v): def _format_delay(hours): total_minutes = round(max(float(hours), 0) * 60) h, m = divmod(total_minutes, 60) - return f"{h}:{m:02d}:00" + return f"{h:02d}:{m:02d}:00" def _delay_field(rep): diff --git a/tests/test_operational_capability.py b/tests/test_operational_capability.py index 0124b3d..8411557 100644 --- a/tests/test_operational_capability.py +++ b/tests/test_operational_capability.py @@ -139,7 +139,7 @@ class TestDelayFieldFallback: assert result is not None path, body = result assert path == ["operational", "state", "vs", "0"] - assert body == {"x.com.samsung.da.delayEndTime": "1:30:00"} + assert body == {"x.com.samsung.da.delayEndTime": "01:30:00"} def test_write_targets_delay_start_time_by_default(self): from custom_components.localthings.registry.capabilities.operational import ( @@ -156,4 +156,4 @@ class TestDelayFieldFallback: result = desc.write_fn(1.5, rep) assert result is not None _path, body = result - assert body == {"x.com.samsung.da.delayStartTime": "1:30:00"} + assert body == {"x.com.samsung.da.delayStartTime": "01:30:00"}