themillhousegroup / openhab2-addons

Add-ons for openHAB 2.x
Eclipse Public License 2.0
36 stars 17 forks source link

Feature/sp3 nightlight #2

Closed FreddyFox closed 5 years ago

FreddyFox commented 5 years ago

This PR adds support for toggling the night light on SP3 devices.

To not make a mess I had to refactor the BroadlinkSocketModel2Handler quite a bit. You should read over and see if it makes sense. I will gladly change some stuff if it looks a bit awkward with all the helper functions and long function names :)

EDIT: I realize I didn't remove the power consumption code before committing, but the code that makes it run is commented out. I will make a new PR with only the night light code if you think the code is ready to be merged.

Tested, not very thoroughly, but verified to work on Ubuntu 16.04 running OpenHAB 2.2 in docker.

Please let me know if you would like me to supply the .JAR