Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions adafruit_slideshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -276,7 +280,7 @@ def _set_backlight(self, brightness):
else:
try:
self._display.brightness = brightness
except RuntimeError:
except (RuntimeError, AttributeError):
pass

@property
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down