-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix setting brightness to max value and brightness fading loop condition #35
Conversation
Martin-HiPi
commented
Jul 14, 2021
- Function _denormalize_brightness does not clamp the output to the normal 0-255 int() range. Force-clamped 0-255 now.
- Function _normalize_brightness does not clamp the output to the normal 0-100 percent range. Force-clamped 0-100 now.
- In @brightness.setter, the while loop looks only for current_value != value. In some circumstances, it won't stop incrementing. Hard-clamped to 0-100 percent range.
- Function _denormalize_brightness does not clamp the output to the normal 0-255 int() range. Force-clamped 0-255 now. - Function _normalize_brightness does not clamp the output to the normal 0-100 percent range. Force-clamped 0-100 now. - In @brightness.setter, the while loop looks only for current_value != value. In some circumstances, it won't stop incrementing. Hard-clamped to 0-100 percent range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but neither debug printing nor commented code should be included. Also failing the black formatting check.
Thanks @linusg for taking the time to review the PR. I'm not too familiar with the black formatting part, anything you can point me to? |
|
I used what showed in the logs to re-write the while conditions.
@linusg Thanks for the info! |
Fixed one missing space in def _normalize_brightness that caused the black formatting check to fail.
Two lines had spaces at the end. These are obviously invisible in black logs unless you actively search for them!
Thanks for the fixes! |