Skip to content

Commit

Permalink
Merge pull request #123 from dhalbert/no-auto-brightness
Browse files Browse the repository at this point in the history
handle no .auto-brightness
  • Loading branch information
dhalbert committed Aug 10, 2022
2 parents 5679332 + 919c358 commit 0dd7600
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_pyportal/peripherals.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def set_backlight(self, val):
if self._backlight:
self._backlight.duty_cycle = int(val * 65535)
else:
self._display.auto_brightness = False
try:
self._display.auto_brightness = False
except AttributeError:
pass
self._display.brightness = val

def play_file(self, file_name, wait_to_finish=True):
Expand Down

0 comments on commit 0dd7600

Please sign in to comment.