From 919c3584e64dbbb038d297a190010ea2cae43b69 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 10 Aug 2022 14:00:35 -0400 Subject: [PATCH] handle no .auto-brightness --- adafruit_pyportal/peripherals.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adafruit_pyportal/peripherals.py b/adafruit_pyportal/peripherals.py index 3076cfc..8042f1c 100755 --- a/adafruit_pyportal/peripherals.py +++ b/adafruit_pyportal/peripherals.py @@ -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):