Skip to content

Commit

Permalink
Merge pull request #26 from ladyada/master
Browse files Browse the repository at this point in the history
update for use with eink displays,
  • Loading branch information
ladyada committed Nov 15, 2020
2 parents 2ac4518 + 1c20099 commit 9cfed13
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 9cfed13

Please sign in to comment.