Skip to content

fix sync when there are multiple different pixel objects involved #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2020
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: 10 additions & 1 deletion adafruit_led_animation/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation.git"

from adafruit_led_animation.animation import Animation


class AnimationGroup:
"""
Expand Down Expand Up @@ -158,7 +160,14 @@ def animate(self, show=True):
if self._sync:
result = self._members[0].animate(show=False)
if result and show:
self._members[0].show()
last_strip = None
for member in self._members:
if isinstance(member, Animation):
if last_strip != member.pixel_object:
member.pixel_object.show()
last_strip = member.pixel_object
else:
member.show()
return result

return any([item.animate(show) for item in self._members])
Expand Down