laundry: add Table_00 cycle labels for WF45R6300 washer and DVE45R6300 dryer
Adds washer_cycle_table_00 and dryer_cycle_table_00 translation catalog entries, confirmed by the issue #357 reporter selecting each cycle on a WF45R6300AW/US washer and DVE45R6300W/A3 dryer and reading back the raw course code. Table_00 is a separate, older course-code family from the existing Table_02/Table_03 catalogs -- laundry.cycle_select's table_href scoping already keeps them apart, so this is a translations-only change. Table_00 was previously used only as an example of an unconfirmed table in tests; those now use Table_99 for that role, and new tests assert the confirmed codes translate and that the resolved key routes to the new table-scoped catalog entries. Mirrored to all shipped languages (cs/de/es/it/ko/nl) to keep tests/test_translations.py's key-for-key invariant.
This commit is contained in:
12 files changed
+271
-6
No files matched your search
@@ -89,6 +89,20 @@ def test_course_bound_to_shared_course_vs_0():
|
||||
assert desc.rep_fn(rep) == "16"
|
||||
|
||||
|
||||
def test_reported_table_00_course_codes_are_translated():
|
||||
"""The reporter confirmed these codes on a DVE45R6300W/A3 by selecting
|
||||
each cycle and reading back the raw course code (issue #357)."""
|
||||
from custom_components.localthings.catalog import translated_states
|
||||
|
||||
desc = next(
|
||||
e for e in dryer.DRYER_COURSE.entities if e.key == "cycle" and isinstance(e, SelectDesc)
|
||||
)
|
||||
table_00 = {"/st/dryercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_00"}}
|
||||
assert desc.translation_key(table_00) == "dryer_cycle_table_00"
|
||||
confirmed = {"01", "9c", "a5", "9e", "9b", "27", "a0", "a4", "a6", "a3", "a2"}
|
||||
assert confirmed <= translated_states("select", "dryer_cycle_table_00")
|
||||
|
||||
|
||||
def test_st_dryercourse_is_ignored():
|
||||
"""/st/dryercourse/vs/0 re-encodes the course exposed via /course/vs/0 and
|
||||
is globally ignored -- the mirror of /st/washercourse/vs/0."""
|
||||
|
||||
@@ -369,7 +369,7 @@ class TestCycleSelectTableGating:
|
||||
def test_untranslated_table_uses_generic_cycle_key(self):
|
||||
"""An unknown table does not claim another board's state labels."""
|
||||
desc = self._desc()
|
||||
resources = {"/st/washercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_00"}}
|
||||
resources = {"/st/washercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_99"}}
|
||||
assert desc.translation_key(resources) == "cycle"
|
||||
|
||||
def test_resolves_to_generic_cycle_when_table_id_is_unknown(self):
|
||||
|
||||
@@ -99,16 +99,18 @@ class TestWasherCourse:
|
||||
|
||||
def test_translation_key(self):
|
||||
"""Table-scoped (issue: course codes aren't guaranteed consistent
|
||||
across board generations sharing /course/vs/0 -- FlexWash's older
|
||||
board reports Table_00, not the Table_02 every washer_cycle_table_02
|
||||
name was confirmed against) -- see laundry.cycle_select. Only a
|
||||
verified table gets table-specific state translations."""
|
||||
across board generations sharing /course/vs/0 -- a device reporting
|
||||
an unrecognized table id must not borrow another board generation's
|
||||
labels) -- see laundry.cycle_select. Only a verified table gets
|
||||
table-specific state translations."""
|
||||
desc = next(e for e in washer.WASHER_COURSE.entities if e.key == "cycle")
|
||||
assert callable(desc.translation_key)
|
||||
table_02 = {"/st/washercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_02"}}
|
||||
assert desc.translation_key(table_02) == "washer_cycle_table_02"
|
||||
table_00 = {"/st/washercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_00"}}
|
||||
assert desc.translation_key(table_00) == "cycle"
|
||||
assert desc.translation_key(table_00) == "washer_cycle_table_00"
|
||||
unrecognized = {"/st/washercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_99"}}
|
||||
assert desc.translation_key(unrecognized) == "cycle"
|
||||
assert desc.translation_key({}) == "cycle"
|
||||
|
||||
def test_reads_raw_course_code_from_options_array(self):
|
||||
@@ -146,6 +148,15 @@ class TestWasherCourse:
|
||||
}
|
||||
assert confirmed <= translated_states("select", "washer_cycle_table_02")
|
||||
|
||||
def test_reported_table_00_course_codes_are_translated(self):
|
||||
"""The reporter confirmed these codes on a WF45R6300AW/US by
|
||||
selecting each cycle and reading back the raw course code
|
||||
(issue #357)."""
|
||||
from custom_components.localthings.catalog import translated_states
|
||||
|
||||
confirmed = {"01", "70", "55", "71", "72", "77", "57", "73", "74", "75", "78"}
|
||||
assert confirmed <= translated_states("select", "washer_cycle_table_00")
|
||||
|
||||
def test_missing_course_option_returns_none(self):
|
||||
desc = next(e for e in washer.WASHER_COURSE.entities if e.key == "cycle")
|
||||
assert desc.rep_fn is not None
|
||||
|
||||
Reference in new issue
Block a user