new animation: RotatingRainbowBeamerBlack #9
3 changed files with 32 additions and 3 deletions
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
commit
69840b41fc
23
animation.py
23
animation.py
|
|
@ -239,6 +239,29 @@ class RotatingRainbowKitchenWhite(Animation):
|
||||||
def name(self):
|
def name(self):
|
||||||
return "kitchenlight"
|
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):
|
class Chase(Steady):
|
||||||
def __init__(self, color, looptime=1.0):
|
def __init__(self, color, looptime=1.0):
|
||||||
|
|
|
||||||
4
dmx.py
4
dmx.py
|
|
@ -6,7 +6,7 @@ from time import sleep
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from animation import Animation, Off, RandomSingle, Steady, FadeTo, RotatingRainbow, Chase, TwoColor, Caramelldansen, \
|
from animation import Animation, Off, RandomSingle, Steady, FadeTo, RotatingRainbow, Chase, TwoColor, Caramelldansen, \
|
||||||
Hackertours, RotatingRainbowKitchenWhite
|
Hackertours, RotatingRainbowKitchenWhite, RotatingRainbowBeamerBlack
|
||||||
|
|
||||||
|
|
||||||
def ledlog(value):
|
def ledlog(value):
|
||||||
|
|
@ -154,6 +154,8 @@ class DMX:
|
||||||
animation = Hackertours(self._color)
|
animation = Hackertours(self._color)
|
||||||
elif animation == "kitchenlight":
|
elif animation == "kitchenlight":
|
||||||
animation = RotatingRainbowKitchenWhite()
|
animation = RotatingRainbowKitchenWhite()
|
||||||
|
elif animation == "beamermode":
|
||||||
|
animation = RotatingRainbowBeamerBlack()
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"No such animation {animation}")
|
raise ValueError(f"No such animation {animation}")
|
||||||
self._animation = animation
|
self._animation = animation
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@
|
||||||
<div>
|
<div>
|
||||||
<input type="radio" class="js_animation" name="state" id="animation_kitchenlight" value="kitchenlight"/>
|
<input type="radio" class="js_animation" name="state" id="animation_kitchenlight" value="kitchenlight"/>
|
||||||
<label for="animation_kitchenlight">Kitchenlight</label>
|
<label for="animation_kitchenlight">Kitchenlight</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="radio" class="js_animation" name="state" id="animation_beamermode" value="beamermode"/>
|
||||||
|
<label for="animation_kitchenlight">Beamer Mode</label>
|
||||||
</div>
|
</div>
|
||||||
% end
|
% end
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue