feat(fridge): expose discrete cooler temperature setpoint (#186)
RT42DG6630B1FZ is a single-door "cooler only" fridge that reports its setpoint on /temperature/definite/cooler/vs/0 -- a vendor resource outside both TEMP_CURRENT_GENERIC's '/temperature/current/' and TEMP_SETPOINT's '/temperature/desired/' href prefixes, so it was entirely unbound and the setting stayed app-only. Its supportedList (1/2/3/4/7 °C) isn't a contiguous range, so this is modeled as a select over the device's own live options rather than a NumberDesc that would let a user pick an unsupported value like 5 or 6.
This commit is contained in:
8 files changed
+540
No files matched your search
@@ -895,6 +895,28 @@ def test_registry_reproduces_golden_state_keys_for_airconditioner_artik051_krac_
|
||||
)
|
||||
|
||||
|
||||
def test_registry_reproduces_golden_state_keys_for_refrigerator_definite_cooler():
|
||||
"""RT42DG6630B1FZ (issue #186) -- a single-door "cooler only" fridge whose
|
||||
/temperature/definite/cooler/vs/0 doesn't match either
|
||||
TEMP_CURRENT_GENERIC's '/temperature/current/' or TEMP_SETPOINT's
|
||||
'/temperature/desired/' href prefix, so temperature control was entirely
|
||||
unbound. Resolved via the new DEFINITE_TEMPERATURE_COOLER capability
|
||||
(a select over the device's own discrete supportedList, not a
|
||||
continuous NumberDesc range -- 5 and 6 aren't valid setpoints on this
|
||||
model). Binds cleanly with zero unbound hrefs."""
|
||||
from tests.conftest import _load_device
|
||||
resources = _load_device('refrigerator_definite_cooler')
|
||||
golden = json.loads(
|
||||
(GOLDEN / 'refrigerator_definite_cooler.json').read_text()
|
||||
)
|
||||
state_keys = _new_state_keys('refrigerator_definite_cooler', 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
|
||||
dump = {
|
||||
|
||||
Reference in new issue
Block a user