veeceeoh / xiaomi-hubitat

veeceeoh's Xiaomi device drivers for the Hubitat Elevation Hub
Apache License 2.0
74 stars 47 forks source link

Aqara Smart Light Switch - wireless 2 button: [RELEASE] v0.5 Ready to use #7

Closed veeceeoh closed 6 years ago

veeceeoh commented 6 years ago

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 of endpoint object • added string list object pressType to use for pushed event description text • changed button "pushed" sendEvent() to map = to be used in return createEvent(map) at end of function • added lastPressed & lastPressedDate for WebCoRE users • added isStateChange: true and description text to button press event • minor code and comments cleanup

veeceeoh commented 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.

veeceeoh commented 6 years ago

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