Randomize animations
All checks were successful
docker-image / docker (push) Successful in 9m53s

This commit is contained in:
Stefan Bethke 2025-06-15 18:25:30 +02:00
commit f407348d63

View file

@ -146,14 +146,9 @@ class BubaAnimator:
self.log.debug("No animations, sleeping...")
sleep(2)
else:
while True:
next = random.randint(0, len(self.animations) - 1)
if next != last:
break
last = next
a = self.animations[next]
self.log.debug(f"Starting animation: {a}")
a.run()
for a in random.sample(self.animations, len(self.animations)):
self.log.debug(f"Starting animation: {a}")
a.run()
def add(self, animation, *args, **kwargs):
self.animations.append(animation(self.buba, *args, **kwargs))