Skip to content

Commit 919c358

Browse files
committed
handle no .auto-brightness
1 parent 5679332 commit 919c358

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_pyportal/peripherals.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ def set_backlight(self, val):
138138
if self._backlight:
139139
self._backlight.duty_cycle = int(val * 65535)
140140
else:
141-
self._display.auto_brightness = False
141+
try:
142+
self._display.auto_brightness = False
143+
except AttributeError:
144+
pass
142145
self._display.brightness = val
143146

144147
def play_file(self, file_name, wait_to_finish=True):

0 commit comments

Comments
 (0)