-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug that changed brightness at each HSV update (#124)
* Fix bug that changed brightness at each hsv update The HSV setter should accept a percentage for the brightness value but actually assumed the brightness to be in absolute values between 1 and 255. This resulted in brightness reductions at each HSV update, in steps of 100% -> 100/255=39% -> 39/255=15% -> ... (see also home-assistant/core#15582, where I originally reported this bug). * Modify HSV property to return brightness in percent Switch from reported brightness values of 1..255 to percentage values, for consistency with the apidoc and 8761dd8. * Add checks and tests for the hsv setter - make sure that new (hue, saturation, brightness) values are within their valid ranges (0..255, 0..100, 0..100) and raise SmartDeviceException if they are not - add test function for the hsv setter
- Loading branch information
Showing
2 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters