Closed veeceeoh closed 6 years ago
@gn0st1c - Thanks again for making the device driver for the 2 button Aqara Wireless Smart Light Switch!
I made a few very small changes to match it better with the other device drivers. Otherwise I think it's perfectly usable.
I won't get a chance to test the changes until tonight (9 hours from now) so I will wait to merge this and announce it on the Xiaomi device driver Hubitat forum thread.
Most recent update:
Changes
• changed preference titles to match other device drivers
• rearranged order or preferences for better display in Hubitat web UI
• removed voltsmax
/ voltsmin
default values because Hubitat ignores them
• added code to updated() to force voltsmax
/ voltsmin
to defaults if blank, or to min/max if out of range
• changed check of batteryLastReplaced
in init() to use device.currentValue()
• added reset of debugLogging
to configure()
so pairing install log messages are displayed before logging display defaults to off
• added (value)
to push()
function to avoid Groovy error and changed debug log message to be more explanatory
• other minor formatting fixes for consistency with other device drivers
Changes • changed name in header to be more specific and include model number • changed name in definition to be more specific • moved
Integer.parseInt()
up to the definition ofendpoint
object • added string list object pressType to use for pushed event description text • changed button "pushed"sendEvent()
tomap =
to be used inreturn createEvent(map)
at end of function • addedlastPressed
&lastPressedDate
for WebCoRE users • addedisStateChange: true
and description text to button press event • minor code and comments cleanup