Skip to content

Turn off auto_brightness if brightness is set #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2019

Conversation

dhalbert
Copy link
Collaborator

Fixes #1796.

auto_brightness was interfering with setting brightness manually. Changed the semantics per @makermelissa's suggestion to disable auto_brightness if brightness is set.

@dhalbert dhalbert requested a review from tannewt April 18, 2019 17:59
@deshipu
Copy link

deshipu commented Apr 18, 2019

Should we also disable manual brightness when auto-brightness is enabled?

How about having just one attribute brightness, and setting it to None for automatic adjustment?

@tannewt
Copy link
Member

tannewt commented Apr 18, 2019

@deshipu With one field you wouldn't be able to read back the auto state. Even in auto the brightness should return the current value so that the manual adjustment can take the current state into account.

tannewt
tannewt previously approved these changes Apr 18, 2019
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Do we want to add kwargs to the constructor for this too? That would be the only way to prevent the auto brightness kicking in immediately.

@dhalbert
Copy link
Collaborator Author

I can do that. There's no way to disable it right away if you use board.DISPLAY, but you can always disable it as soon as your program starts.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you.

@tannewt tannewt merged commit f548305 into adafruit:master Apr 18, 2019
@dhalbert dhalbert deleted the stop-flicker branch May 28, 2019 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flickering when adjusting board.DISPLAY.brightness
3 participants