Commit 94fa228
fix: keep anti-wrinkle alive-then-close it when the power sensor goes silent
The anti-wrinkle idle-timeout (anti_wrinkle_idle_timeout) and the 2 h
safety cap both live in the detector and only advance from within
process_reading, so they need incoming readings to fire. A
publish-on-change power sensor goes completely silent once power
flatlines at standby / 0 W after the last tumble pulse, which freezes
the idle timer mid-count and pins the state in anti_wrinkle until the
next real reading (typically the next cycle).
The manager watchdog injects synthetic 0 W keepalives to advance the
accumulator during silence, but its state guard excluded
STATE_ANTI_WRINKLE, so it never fed that state. Add a dedicated
anti-wrinkle branch that injects a 0 W keepalive once the sensor has
been silent longer than off_delay, so the detector's own idle-timeout
(or the 2 h safety cap) elapses on schedule and the tail closes into
OFF instead of showing anti-wrinkle for hours after the appliance
physically finished.
The synthetic keepalive bumps _last_reading_time, which is also the
sampling-throttle clock in _async_power_changed. A real tumble pulse
(>= min_power, therefore not is_low_power) arriving within one sampling
interval of a keepalive would be discarded by that throttle before
reaching the detector, so it could not reset the idle timer. Exempt
high-power readings from the throttle while in anti_wrinkle; sub-min
baseline readings stay throttled as before.
Adds tests/test_anti_wrinkle_watchdog_keepalive.py: watchdog injection
during anti-wrinkle silence, no injection before off_delay, no-op before
first reading, end-to-end close into OFF under injected keepalives, a
pulse resets the idle timer, the throttle bypass for real pulses, and
that RUNNING high readings / anti-wrinkle baselines are still throttled.
Closes #339
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 11dc122 commit 94fa228
3 files changed
Lines changed: 383 additions & 0 deletions
File tree
- custom_components/ha_washdata
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2859 | 2859 | | |
2860 | 2860 | | |
2861 | 2861 | | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
2862 | 2874 | | |
2863 | 2875 | | |
| 2876 | + | |
2864 | 2877 | | |
2865 | 2878 | | |
2866 | 2879 | | |
| |||
3223 | 3236 | | |
3224 | 3237 | | |
3225 | 3238 | | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
3226 | 3273 | | |
3227 | 3274 | | |
3228 | 3275 | | |
| |||
0 commit comments