added new animation RotatingRainbowKitchenWhite

This commit is contained in:
tessak9 2026-02-20 18:13:24 +01:00
commit e9971b843b
3 changed files with 33 additions and 1 deletions

View file

@ -216,6 +216,30 @@ class RotatingRainbow(Animation):
return "rainbow"
class RotatingRainbowKitchenWhite(Animation):
def __init__(self, looptime=50.0):
super(RotatingRainbowKitchenWhite, self).__init__()
self.looptime = looptime
pass
def update(self, index, count):
"""
Same as RotatingRainbow but the two lights above the kitchen are mapped to white
"""
if (index == 2 or index == 7):
rgb = (255, 255, 255)
else:
hue = (time() / self.looptime + (index + 0.0) / count) % 1.0
rgb = hsv_to_rgb(hue, 1, 1)
return rgb
def __str__(self):
return f"{type(self).__name__}"
def name(self):
return "kitchenlight"
class Chase(Steady):
def __init__(self, color, looptime=1.0):
super(Chase, self).__init__(color)