From b820a96277e0f9ba45cb0e211864a65a62ff9238 Mon Sep 17 00:00:00 2001 From: perseus177 Date: Thu, 6 Aug 2026 12:20:18 +0200 Subject: [PATCH] docs(airconditioner): record that the board zeroes Sleep_ on leaving a sleep mode Review question on #304: a bare Comode_Off written over Comode_Sleep/Sleep_4 read back as Comode_Off/Sleep_0 at +8s and +38s, so the preset path cannot leave a stale duration for the next nano selection to read as a running timer. --- .../localthings/registry/capabilities/airconditioner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/custom_components/localthings/registry/capabilities/airconditioner.py b/custom_components/localthings/registry/capabilities/airconditioner.py index 2a4656e..8faaa94 100644 --- a/custom_components/localthings/registry/capabilities/airconditioner.py +++ b/custom_components/localthings/registry/capabilities/airconditioner.py @@ -420,6 +420,12 @@ def _preset_options(code, rep): Measured: `["Comode_Nano"]` written over `Comode_Sleep`/`Sleep_4` came back as `Comode_NanoSleep`/`Sleep_16`, silently turning the user's two hours into eight. Writing the pair keeps the two hours. + + Leaving a sleep mode needs no such care: the board zeroes the duration by + itself. Measured on the same unit -- a bare `["Comode_Off"]` written over + `Comode_Sleep`/`Sleep_4` read back as `Comode_Off`/`Sleep_0` at +8s and +38s + -- so the `none` preset cannot leave a stale token behind for the next nano + selection to pick up as a running timer. """ sleep = _option_token(rep, "Sleep") running = sleep not in (None, "0")