openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
238 stars 69 forks source link

Add the ability to auto detect supported brightness plugins #50

Closed ZeroErrors closed 3 years ago

ZeroErrors commented 3 years ago

Description

Related issue: fixes https://github.com/openDsh/dash/issues/48

This PR adds the ability to automatically detect the supported brightness plugins.

When the config value for brightness_plugin is set to auto, which is the default, we iterate the available brightness plugins and check if they are supported and select the plugin that is the highest priority supported plugin.

Implementations:

Checklist:

rsjudka commented 3 years ago

i think one issue is that using the rpi screen (and in turn that brightness sysfile existing) does not necessarily guarantee brightness control will be supported (older versions of the screen dont support it). So that would be a case where auto will fail (not a major issue tho)

ZeroErrors commented 3 years ago

oh, wasn't aware that there was cases where it's not supported and the file would exist. I guess we can probably add extra checks when cases come up, if we can detect the display model or something.

rsjudka commented 3 years ago

hmm someone who is more familiar with the pis than myself can chime in, but I haven't heard of a way to detect the different version (v1.0 and v1.1) in sw