I’ll prioritize using the door
value directly for open closed status in the next release. Note that I will still consider closed
as the value to light up SharpTools icons.
The goal is to keep all the highlighted items as indicating an active/secure status for quick glanceability:
switch: on
thermostatMode: not off
motion: active
presence: present
water: wet
lock: locked
contact: closed
door: closed
The challenge with using the switch
attribute as a proxy for other attributes is different DTH developers have different views on mappings. As you can see from the active/secure statuses above, door:closed
= contact:closed
= switch:on
is the logic presently used. Using the more specific attribute (door
) as the primary and more generic value (switch
) as the secondary is the preferred approach though.
door
currently is a fallback value for switch
in isOn()
which is why it was accurate with the copyninja version which implemented the switch
capability but did not implement the switch
attribute and thus fell back to the door
attribute. At some point I had flipped the logic on its head to use the more specific device type attributes before the generic attributes, but it looks like the isOn()
helper method wasn’t updated.