Skip to content

fading fails with float brightness values #59

@fonebone42

Description

@fonebone42

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions