hankhank10 / music-screen-api

Display the playing Sonos track in real time on an e-ink display - also includes functionality for last.fm
117 stars 17 forks source link

Add optional backlight controls #11

Closed jjlawren closed 4 years ago

jjlawren commented 4 years ago

This may require more config options and/or documentation adjustments.

Adds support for the rpi_backlight package which exposes control of the HyperPixel backlight power. If no media is actively playing, the screen is turned off to save power. A cleanup function is added to re-enable the power when exiting.

NOTE: If the script is killed with a signal (e.g., pkill python) the registered atexit method will not run and may leave the screen turned off.

Hardware device permissions for the backlight must be allowed for the user running the script: https://github.com/linusg/rpi-backlight#installation