add new animation RotatingRainbowBeamerBlack

new animation that disables the lights on the projector side of the room
mostly copied from the kitchenlight effect by tessak9
This commit is contained in:
dario 2026-05-16 22:07:14 +02:00
commit 69840b41fc
Signed by: dario
SSH key fingerprint: SHA256:zP7OE8nhYwOWaDhOawrP6NmUVcZWi0wyPKQa6052GpM
3 changed files with 32 additions and 3 deletions

View file

@ -239,6 +239,29 @@ class RotatingRainbowKitchenWhite(Animation):
def name(self):
return "kitchenlight"
class RotatingRainbowBeamerBlack(Animation):
def __init__(self, looptime=50.0):
super(RotatingRainbowBeamerBlack, self).__init__()
self.looptime = looptime
pass
def update(self, index, count):
"""
Same as RotatingRainbow but the lights on the projector side are mapped to black
"""
if (index in [2, 4, 5, 6]):
rgb = (0, 0, 0)
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 "beamermode"
class Chase(Steady):
def __init__(self, color, looptime=1.0):
@ -306,4 +329,4 @@ def hsv_to_rgb(h, s, v):
return [int(r * 255), int(g * 255), int(b * 255)]
def rgb_to_hsv(r, g, b):
return colorsys.rgb_to_hsv(r/255,g/255,b/255)
return colorsys.rgb_to_hsv(r/255,g/255,b/255)