Compare commits
3 commits
beamermode
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d5b9d9d1a3 | |||
| 60539a215f | |||
| af8a7d6992 |
5 changed files with 21 additions and 38 deletions
23
animation.py
23
animation.py
|
|
@ -239,29 +239,6 @@ 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, RotatingRainbowBeamerBlack
|
Hackertours, RotatingRainbowKitchenWhite
|
||||||
|
|
||||||
|
|
||||||
def ledlog(value):
|
def ledlog(value):
|
||||||
|
|
@ -154,8 +154,6 @@ 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
|
||||||
|
|
|
||||||
19
poetry.lock
generated
19
poetry.lock
generated
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand.
|
# This file is automatically @generated by Poetry 2.3.4 and should not be changed by hand.
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bottle"
|
name = "bottle"
|
||||||
|
|
@ -6,12 +6,25 @@ version = "0.12.25"
|
||||||
description = "Fast and simple WSGI-framework for small web-applications."
|
description = "Fast and simple WSGI-framework for small web-applications."
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = "*"
|
||||||
|
groups = ["main"]
|
||||||
files = [
|
files = [
|
||||||
{file = "bottle-0.12.25-py3-none-any.whl", hash = "sha256:d6f15f9d422670b7c073d63bd8d287b135388da187a0f3e3c19293626ce034ea"},
|
{file = "bottle-0.12.25-py3-none-any.whl", hash = "sha256:d6f15f9d422670b7c073d63bd8d287b135388da187a0f3e3c19293626ce034ea"},
|
||||||
{file = "bottle-0.12.25.tar.gz", hash = "sha256:e1a9c94970ae6d710b3fb4526294dfeb86f2cb4a81eff3a4b98dc40fb0e5e021"},
|
{file = "bottle-0.12.25.tar.gz", hash = "sha256:e1a9c94970ae6d710b3fb4526294dfeb86f2cb4a81eff3a4b98dc40fb0e5e021"},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "legacy-cgi"
|
||||||
|
version = "2.6.4"
|
||||||
|
description = "Fork of the standard library cgi and cgitb modules removed in Python 3.13"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.8"
|
||||||
|
groups = ["main"]
|
||||||
|
files = [
|
||||||
|
{file = "legacy_cgi-2.6.4-py3-none-any.whl", hash = "sha256:7e235ce58bf1e25d1fc9b2d299015e4e2cd37305eccafec1e6bac3fc04b878cd"},
|
||||||
|
{file = "legacy_cgi-2.6.4.tar.gz", hash = "sha256:abb9dfc7835772f7c9317977c63253fd22a7484b5c9bbcdca60a29dcce97c577"},
|
||||||
|
]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.1"
|
||||||
python-versions = "^3.9"
|
python-versions = "^3.9"
|
||||||
content-hash = "861e3ad9d0b00deb876d2ca7797a608f215c7b91ec9b38f367b24bd096a28478"
|
content-hash = "19caa4a129f9c7cc8e35e26de5edb2eb372f191ab9dfa0c5cc57b75dc04a8d9a"
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,12 @@ name = "foobazdmx"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Stefan Bethke <stb@lassitu.de>"]
|
authors = ["Stefan Bethke <stb@lassitu.de>"]
|
||||||
#package-mode = false
|
package-mode = false
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.9"
|
python = "^3.9"
|
||||||
bottle = "^0.12.21"
|
bottle = "^0.12.21"
|
||||||
|
legacy-cgi = "^2.6.4"
|
||||||
[tool.poetry.dev-dependencies]
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,6 @@
|
||||||
<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