diff --git a/adafruit_slideshow.py b/adafruit_slideshow.py index e16c393..d7fcdb8 100755 --- a/adafruit_slideshow.py +++ b/adafruit_slideshow.py @@ -238,7 +238,11 @@ def __init__( display.show(self._group) self._backlight_pwm = backlight_pwm - if not backlight_pwm and fade_effect: + if ( + not backlight_pwm + and fade_effect + and hasattr(self._display, "auto_brightness") + ): self._display.auto_brightness = False # Show the first image @@ -276,7 +280,7 @@ def _set_backlight(self, brightness): else: try: self._display.brightness = brightness - except RuntimeError: + except (RuntimeError, AttributeError): pass @property @@ -316,7 +320,6 @@ def update(self): now = time.monotonic() if not self.auto_advance or now - self._img_start < self.dwell: return True - return self.advance() # pylint: disable=too-many-branches @@ -380,6 +383,8 @@ def advance(self): ) self._group.append(sprite) + if hasattr(self._display, "refresh"): + self._display.refresh() self._fade_up() self._img_start = time.monotonic()