Add kimchi-refrigerator compartment coverage (issue #26)
TP2X_REF_20K-class 3-compartment kimchi refrigerators report each compartment's storage mode and ripening status/timer on /status/kimchi/<slot>/vs/0, plus a top-compartment door sensor on /kimchidoors/top/vs/0 -- all previously unbound. Bind them as pattern capabilities (fridge.KIMCHI_ZONE, fridge.KIMCHI_DOOR_GENERIC), deriving the per-compartment entity key and display name from the href's top/middle/bottom segment, the same way DOOR_GENERIC/TEMP_CURRENT_GENERIC already do. Storage-mode option labels were translated directly from the reporter's own SmartThings app screenshots rather than guessed from the raw device codes or their English paraphrase, confirming the on-screen option order matches supportMode's array order (including the freezer triplet's -19/-21/-17°C -> Standard/Strong/Weak mapping). Also tighten FLEX_ZONE's exists_fn: this device's /mode/vs/0 also populates modes/supportedOptions, but with a token shape that never overlaps (a "_[n]:[n]" suffix supportedOptions carries that modes never repeats), so the existing "supportedOptions is nonempty" check let the entity bind anyway and get stuck permanently on "unknown". Requiring an actual resolvable value keeps it working for the RF9000/Bespoke-class fridges it was built for while leaving it absent here.
This commit is contained in:
8 files changed
+579
-2
No files matched your search
@@ -300,6 +300,23 @@ def test_registry_reproduces_golden_state_keys_for_tp2x_ref_20k():
|
||||
)
|
||||
|
||||
|
||||
def test_registry_reproduces_golden_state_keys_for_tp2x_ref_20k_kimchi():
|
||||
"""A different physical unit reporting the same "TP2X_REF_20K" modelNum
|
||||
string as the fixture above (issue #26's second reporter) -- a
|
||||
3-compartment kimchi refrigerator with no flex zone, doors/icemaker, or
|
||||
freezer/cooler split, but its own /status/kimchi/<slot>/vs/0 and
|
||||
/kimchidoors/top/vs/0 resources (fridge.KIMCHI_ZONE/KIMCHI_DOOR_GENERIC)."""
|
||||
from tests.conftest import _load_device
|
||||
resources = _load_device('refrigerator_tp2x_ref_20k_kimchi')
|
||||
golden = json.loads((GOLDEN / 'refrigerator_tp2x_ref_20k_kimchi.json').read_text())
|
||||
state_keys = _new_state_keys('refrigerator_tp2x_ref_20k_kimchi', 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_registry_reproduces_golden_state_keys_for_ac_tp1x_da_ac_rac_01011():
|
||||
"""Newer AC firmware (Tizen Lite, oneUiVersion "7.0 Air conditioner"; model
|
||||
TP1X_DA-AC-RAC-01011) reports temperature via the vendor /temperatures/vs/0
|
||||
|
||||
Reference in new issue
Block a user