* 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.
In certain cases the SmartSense Multi Sensors are
missing the Y and Z axis, causing an exception
during .parseAxis(). This change checks that all
3 axis are present before processing the rest of
the message.
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
This works around the sengled bulbs not following the ZCL spec and using
the value 0xFF as a valid level (the spec says it should be invalid).
It does this by manually setting the level of the bulb to
0xFE (SmartThings 100%) when it is configured, or if it previously had a
level set, manually setting it to that value. This avoids the issue of
the bulb reporting 0xFF and having the library ignore it because it is
an invalid value.
This resolves: https://smartthings.atlassian.net/browse/ICP-691
In configure we were setting up the battery level to be reported every
20 seconds but we weren't reading the attribute so it would take 20
seconds before the battery level was reported. Now we read it during
configure so it is updated right away after join.
https://smartthings.atlassian.net/browse/DVCSMP-2568