rpi-backlight icon indicating copy to clipboard operation
rpi-backlight copied to clipboard

fading fails with float brightness values

Open fonebone42 opened this issue 1 year ago • 0 comments

try the following

from rpi_backlight import Backlight

backlight = Backlight()<br/>
backlight.fade_duration = 0.5  
backlight.brightness = 0     -- works as expected  
backlight.brightness = 10    -- works as expected
backlight.brightness = 4.2   -- works as expected
backlight.brightness = 4.3   -- DOES NOT WORK AS EXPECTED, takes much more than 0.5sec and brightness goes to max

I guess the problem lies here (rpi_backlight/init.py(194)brightness())

192               while (
193                     0.0 <= current_value
**194                   and current_value != value    
195                     and current_value <= 100.0
196                 ):

my environment: rpi-backlight 2.6.0 on Rabpberry Pi 3B running Linux raspi1 6.1.21-v7+ with Raspberry Original 7inch display v1.1

fonebone42 avatar Jan 25 '24 12:01 fonebone42