Add dryer Drum Clean+ tracking; fix multi-entry DrumCleanLog parsing (#258)
Dryers report the same DrumCleanProposal_/WashingTimes_/DrumCleanLog_ options[] tokens washer.py already models for issue #9, so drum_clean_cycles_remaining/drum_clean_last_cleaned move to laundry.py and get bound on dryer's /course/vs/0 too. DrumCleanLog_ on the reporter's dump is a '|'-joined history of every past clean rather than washer's single bare timestamp -- the shared helper now takes the last (most recent) entry, which turns out to also fix a latent bug on four existing washer fixtures whose own DrumCleanLog_ was already multi-entry and silently failing to parse into drum_clean_last_cleaned. No heat-exchanger-clean tracking was found in either dump #258 supplied; noted in dryer.py so a future report knows this was checked.
This commit is contained in:
1 parent
cf09247e39
commit
e6d7dcddc8
11 files changed
+674
-42
No files matched your search
@@ -72,7 +72,12 @@ def test_registry_reproduces_golden_state_keys_for_ehs():
|
||||
def test_registry_reproduces_golden_state_keys_for_washer_wa8000t():
|
||||
"""Top-load washer (WA8000T, issue #106) reports no oneUiVersion and
|
||||
used the 'WA' consumer-model prefix, previously unmapped in
|
||||
_CONSUMER_PREFIX_TO_KEY -- fell back to 'unknown'."""
|
||||
_CONSUMER_PREFIX_TO_KEY -- fell back to 'unknown'.
|
||||
|
||||
Also gains drum_clean_last_cleaned (issue #258): this fixture's
|
||||
DrumCleanLog_ is a '|'-joined multi-entry history, which always failed
|
||||
datetime.fromisoformat and silently returned None before
|
||||
laundry.drum_clean_last_cleaned learned to take the last entry."""
|
||||
from tests.conftest import _load_device
|
||||
|
||||
resources = _load_device("washer_wa8000t")
|
||||
@@ -270,7 +275,10 @@ def test_registry_reproduces_golden_state_keys_for_range_hood():
|
||||
def test_registry_reproduces_golden_state_keys_for_washer_flexwash():
|
||||
"""FlexWash twin washers (WV-prefix consumer model, e.g. WV55M9600AW)
|
||||
report no oneUiVersion and previously fell through for_device_by_model's
|
||||
consumer-prefix map entirely -- issue #19."""
|
||||
consumer-prefix map entirely -- issue #19.
|
||||
|
||||
Also gains drum_clean_last_cleaned (issue #258) -- see the wa8000t test
|
||||
above for why."""
|
||||
from tests.conftest import _load_device
|
||||
|
||||
resources = _load_device("washer_flexwash")
|
||||
@@ -285,7 +293,10 @@ def test_registry_reproduces_golden_state_keys_for_washer_flexwash():
|
||||
|
||||
def test_registry_reproduces_golden_state_keys_for_washer_dryer_combo():
|
||||
"""Washer/dryer combo units carry a writable dryLevel field on
|
||||
/washer/vs/0 itself, with no separate dryer resource -- issue #22."""
|
||||
/washer/vs/0 itself, with no separate dryer resource -- issue #22.
|
||||
|
||||
Also gains drum_clean_last_cleaned (issue #258) -- see the wa8000t test
|
||||
above for why."""
|
||||
from tests.conftest import _load_device
|
||||
|
||||
resources = _load_device("washer_dryer_combo")
|
||||
@@ -622,7 +633,10 @@ def test_registry_reproduces_golden_state_keys_for_washer_wa55a7700av():
|
||||
-- a different board generation than the WA8000T's TP2_20_COMMON,
|
||||
reached through the same 'WA' consumer-model-prefix fallback (issue
|
||||
#106). Binds cleanly against the existing washer registry with zero
|
||||
unbound hrefs."""
|
||||
unbound hrefs.
|
||||
|
||||
Also gains drum_clean_last_cleaned (issue #258) -- see the wa8000t test
|
||||
above for why."""
|
||||
from tests.conftest import _load_device
|
||||
|
||||
resources = _load_device("washer_wa55a7700av")
|
||||
@@ -1263,6 +1277,25 @@ def test_registry_reproduces_golden_state_keys_for_airconditioner_tp1x_fac_time_
|
||||
)
|
||||
|
||||
|
||||
def test_registry_reproduces_golden_state_keys_for_dryer_tp1_21_drum_clean():
|
||||
"""DA_WM_TP1_21_COMMON/DV9400B (issue #258) is the first dryer dump with
|
||||
live DrumCleanProposal_/WashingTimes_ tokens (dryer's default fixture
|
||||
only ever had 'DrumCleanLog_Empty', same as the parallel washer capability
|
||||
started from) -- locks in the new drum_clean_cycles_remaining/
|
||||
drum_clean_last_cleaned entities, including the dryer-specific
|
||||
'|'-joined multi-timestamp DrumCleanLog_ shape."""
|
||||
from tests.conftest import _load_device
|
||||
|
||||
resources = _load_device("dryer_tp1_21_drum_clean")
|
||||
golden = json.loads((GOLDEN / "dryer_tp1_21_drum_clean.json").read_text())
|
||||
state_keys = _new_state_keys("dryer_tp1_21_drum_clean", resources)
|
||||
assert set(state_keys) == set(golden["state_keys"]), (
|
||||
f"state_keys mismatch:\n"
|
||||
f" extra: {sorted(set(state_keys) - set(golden['state_keys']))}\n"
|
||||
f" missing: {sorted(set(golden['state_keys']) - set(state_keys))}"
|
||||
)
|
||||
|
||||
|
||||
def test_resources_from_batch_preferred_over_flat():
|
||||
from tests.conftest import _resources_from_dump
|
||||
|
||||
|
||||
Reference in new issue
Block a user