KIDS_LOCK_VS_FALLBACK's write_fn wrote 'Enable', a value no dump in the fixture corpus (washers, dryers, dishwashers, ovens, ranges, microwaves, air purifiers, air dressers -- everything that lacks the OCF-standard /kidslock/0) has ever reported back; every one reports 'Ready' or 'Run'. It was never a confirmed write contract. #181's reporter tested directly: writing the *correct* value ('Run') still returns 4.05, and the SmartThings app itself has no control for kids lock either -- the resource is genuinely read-only on that hardware, not just wrong-valued. #183's reporter hit the identical symptom (toggle does nothing) on a different device family reporting the same Run/Ready vocabulary. Convert the entity to a read-only BinarySensorDesc. binary_sensor's 'lock' device class is inverted from the old switch reading (On means open/unlocked), so value_fn flips accordingly -- callers reading the flattened 'child_lock' state key need to account for the new polarity. KIDS_LOCK_GENERIC (the OCF-standard /kidslock/0 boolean) is untouched; nothing suggests that one is broken.
This commit is contained in:
5 files changed
+41
-11
No files matched your search
@@ -56,7 +56,10 @@ def test_energy_saving_and_cooktop_alert_present():
|
||||
def test_child_lock_already_reads_correctly():
|
||||
"""issue #183 also reported child lock as unreadable -- but this dump's
|
||||
/kidslock/vs/0 ('Run') and /doors/vs/0's door lock field ('Lock') already
|
||||
agree the door is locked, and the existing common.KIDS_LOCK_VS_FALLBACK
|
||||
already reads that correctly with no code change needed."""
|
||||
agree the door is locked, and common.KIDS_LOCK_VS_FALLBACK already reads
|
||||
that correctly with no further code change needed. Now a read-only
|
||||
binary_sensor (issues #181/#183 -- the write side was never a confirmed
|
||||
contract), whose 'lock' device class is inverted from a switch's plain
|
||||
on/off: False means locked/closed, matching 'Run' here."""
|
||||
state = _state()
|
||||
assert state['child_lock'] is True
|
||||
assert state['child_lock'] is False
|
||||
Reference in new issue
Block a user