Skip to content

Set pixels brightness; recall display brightness setting in auto dim mode #11

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 3 commits into from
Dec 6, 2019
Merged

Set pixels brightness; recall display brightness setting in auto dim mode #11

merged 3 commits into from
Dec 6, 2019

Conversation

CedarGroveStudios
Copy link
Contributor

  1. Add the capability to set pixel brightness when instantiating PyBadger. Use the standard value range for NeoPixels. If omitted, default to brightness value of 1.0. Example:
from adafruit_pybadger import PyBadger
pybadger = PyBadger(pixels_brightness=0.01)
  1. Use setter value rather than brightness=1.0 when restoring to initial brightness with auto_dim_display():
pybadger.brightness = 0.9  # set initial display brightness

@CedarGroveStudios
Copy link
Contributor Author

CedarGroveStudios commented Dec 5, 2019

Travis errors are completely Greek to me. I'll need some help with this one.

@makermelissa
Copy link
Collaborator

Ah, that's an easy one. As it suggests, add 12 spaces to the left of that statement. :)

@CedarGroveStudios
Copy link
Contributor Author

CedarGroveStudios commented Dec 6, 2019

Thanks! Where can I find the Travis details (asked the newbie)?

@makermelissa
Copy link
Collaborator

On the checks tab.

@CedarGroveStudios
Copy link
Contributor Author

Thanks @makermelissa. The browser app's checks tab didn't have that level of detail. Saw that pylint can be used to reveal the details. May be time to switch to Linux.

@@ -103,6 +103,7 @@ def __init__(self, i2c=None):

# Display
self.display = board.DISPLAY
self._brightness_value = 1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

This appears to be a value for display brightness. Can we name it something like _display_brightness so it doesn't get confused with neopixel brightness? It makes reading the code a bit easier. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent idea. I'll make the change.

@makermelissa
Copy link
Collaborator

Sorry, I meant under the Checks tab, you need to click the link labeled "The Build" and it should get you there.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks

@makermelissa makermelissa merged commit 1fd9824 into adafruit:master Dec 6, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 6, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 2.5.2 from 2.4.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#19 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#18 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#17 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#16 from adafruit/dherrada-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 0.9.4 from 0.9.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#11 from CedarGroveStudios/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants