Code brought oever from @varzac commit 8bcbe7b924
Original commit message:
> Fix sengled use of FF for max level
> This works around the fact that sengled element touches can get back
> into a state of reporting an invalid value (of FF) if the physical
> button on the bulb is used to cycle back to the 100% state. Here we
> interpret FF as FE for sengled and then issue a move to level command to
> put it in a state where it will report FE until the level is changed
> again.
>
> This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2597
While the Classic does not have a physical button, since it does represent 100% as FF we want to always catch this.
Previously this device had been changed to use configureAfterSecure to
work around the secure inclusion for Z-Wave. However, support was added
hub side for handling this so it needed to be changed back to using the
normal configure process.
This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2680
Making suggested fixes
making fixes
fixing to correctly use createEvent
fixing DTH
Also adding the fortrezz water valve
refactoring a bit
adding back in debug messages
updating ocf device type
adding zigbee water valve
refactor
There was a common NPE caused by assuming there would be additional
attributes reported with one acceleration value. This corrects it to
instead properly handle the case where there weren't additional
attributes.
This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2668
* rgb(w) bulbs: fix hue/saturation conversion
The attributes used to report Hue and Saturation can have a value of
0-254. We want to translate this to a percentage of 0-100%. The HA
DTHs were dividing by 255 instead of the correct value of 254. Because
the wrong divisor was used the result would be off by a percent about
25% of the time. The ZLL DTHs had the same bug plus they were also
multipling the Hue by 360 instead of 100.
* rgb(w) bulbs: set hue & saturation in a single command
Previous two commands were being used to set Hue and Saturation. Now
a single command is used and a transition time of 0 so the color changes
must faster.
* Don't rely on reporting for hue, saturation and color temperature
Previously we were configuring the RGB(W) and Color Temperature bulbs
to report any Hue, Saturation and Color Temperature changes. Now we
manually read these attributes any time a command is executed that
changes them.