Add device support for Samsung water purifiers (issue #90)
The TP2X_WATERPURIFIER_20K water purifier reports no oneUiVersion and its modelNum/description don't match any consumer-prefix or existing board-family token, so it fell into the unknown-device-type fallback with only common capabilities. Add a new water_purifier registry, routed via a 'WATERPURIFIER' modelNum/description fallback rule. Models dispense settings (type/temperature/capacity/pouring status), sterilize and filter status, favorite-capacity presets, and the three water/buzzer locks. Per the adding-device-support skill's "never hard-code the one dump's values" rule: dispense-capacity bounds and step come live from the device's own desiredCapacityRange/ capacityResolution fields (range_field/step_fn), not a hardcoded constant, and the hot-water-temperature control is a select over the live supportedHotTemperatures list rather than a number with invented bounds, since only a few discrete temperatures are selectable. /mode/vs/0 and /automation/waterpurifier/vs/0 are left unmodeled: the former carries an opaque wizard-workflow token with no coherent current-value contract, the latter is a static support-flags blob with no live setting to expose. Confirmed against the issue #90 diagnostics dump with zero unbound hrefs. Updates the README's supported-appliance-types table for the new device type.
This commit is contained in:
11 files changed
+715
-1
No files matched your search
@@ -85,6 +85,22 @@ def test_registry_reproduces_golden_state_keys_for_airconditioner():
|
||||
)
|
||||
|
||||
|
||||
def test_registry_reproduces_golden_state_keys_for_water_purifier():
|
||||
"""TP2X_WATERPURIFIER_20K (issue #90) reports no oneUiVersion; resolved
|
||||
via the 'WATERPURIFIER' modelNum/description fallback into a dedicated
|
||||
water_purifier registry (dispense settings, sterilize/filter status,
|
||||
favorite capacity, and the three lock switches)."""
|
||||
from tests.conftest import _load_device
|
||||
resources = _load_device('water_purifier')
|
||||
golden = json.loads((GOLDEN / 'water_purifier.json').read_text())
|
||||
state_keys = _new_state_keys('water_purifier', 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_cooktop():
|
||||
from tests.conftest import _load_device
|
||||
resources = _load_device('cooktop')
|
||||
|
||||
Reference in new issue
Block a user