linusg / rpi-backlight

🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display
https://rpi-backlight.readthedocs.io
MIT License
274 stars 31 forks source link

Toggle CLI turns brightness up to 100% #44

Open filmgarage opened 2 years ago

filmgarage commented 2 years ago

If the screen is on and the command power off is sent, the screen is back to the former brightness when turned on again.

For example:

// Brightness 20%
rpi-backlight --p off //screen blank
rpi-backlight --p on // screen 20%

Toggle does not remember the former brightness:

// Brightness 20%
rpi-backlight --p toggle //screen blank
rpi-backlight --p toggle // screen 100%

Is this intentional? I would prefer the previous setting to be remembered.

linusg commented 2 years ago

Yep, that was recently discussed here: https://github.com/linusg/rpi-backlight/pull/40

I consider it a mistake and agree with

I would prefer the previous setting to be remembered.

But apparently it slipped through in the past. A fix would be very welcome!

p1r473 commented 2 years ago

Hi Linus, My pull request includes a fix for this issue https://github.com/p1r473/rpi-backlight/blob/main/rpi_backlight/cli.py#L128

linusg commented 2 years ago

@p1r473 feel free to reopen it then! I generally don't do that myself.