Compare commits
No commits in common. "main" and "hackertours" have entirely different histories.
main
...
hackertour
3 changed files with 5 additions and 46 deletions
9
dmx.py
9
dmx.py
|
|
@ -21,13 +21,9 @@ class RGB:
|
||||||
|
|
||||||
def rgb(self, color):
|
def rgb(self, color):
|
||||||
(r, g, b) = color
|
(r, g, b) = color
|
||||||
try:
|
|
||||||
self.dmx.set(self.slot + self.offset + 0, ledlog(r))
|
self.dmx.set(self.slot + self.offset + 0, ledlog(r))
|
||||||
self.dmx.set(self.slot + self.offset + 1, ledlog(g))
|
self.dmx.set(self.slot + self.offset + 1, ledlog(g))
|
||||||
self.dmx.set(self.slot + self.offset + 2, ledlog(b))
|
self.dmx.set(self.slot + self.offset + 2, ledlog(b))
|
||||||
except Exception as e:
|
|
||||||
print(f'slot={self.slot}, offset={self.offset}')
|
|
||||||
raise(e)
|
|
||||||
|
|
||||||
|
|
||||||
class Bar252(RGB):
|
class Bar252(RGB):
|
||||||
|
|
@ -61,11 +57,6 @@ class ZhennbyPar(RGB):
|
||||||
dmx.set(self.slot + 6, 0)
|
dmx.set(self.slot + 6, 0)
|
||||||
|
|
||||||
|
|
||||||
class Entec6RGBW(RGB):
|
|
||||||
def __init__(self, dmx, slot=1):
|
|
||||||
super(Entec6RGBW, self).__init__(dmx, slot)
|
|
||||||
|
|
||||||
|
|
||||||
class DMX:
|
class DMX:
|
||||||
def __init__(self, host, port=0x1936, universe=1, maxchan=512):
|
def __init__(self, host, port=0x1936, universe=1, maxchan=512):
|
||||||
self._host = host
|
self._host = host
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from typing import Tuple
|
||||||
from bottle import post, request, route, run, static_file, view
|
from bottle import post, request, route, run, static_file, view
|
||||||
|
|
||||||
from animation import Off
|
from animation import Off
|
||||||
from dmx import DMX, Bar252, StairvilleLedPar56, REDSpot18RGB, ZhennbyPar, Entec6RGBW
|
from dmx import DMX, Bar252, StairvilleLedPar56, REDSpot18RGB, ZhennbyPar
|
||||||
|
|
||||||
room = ''
|
room = ''
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ def main(args):
|
||||||
args = parser.parse_args(args)
|
args = parser.parse_args(args)
|
||||||
|
|
||||||
print(f"Starting DMX via Art-Net to {args.artnet}", file=sys.stderr)
|
print(f"Starting DMX via Art-Net to {args.artnet}", file=sys.stderr)
|
||||||
dmx = DMX(args.artnet, maxchan=512, universe=args.universe)
|
dmx = DMX(args.artnet, maxchan=128, universe=args.universe)
|
||||||
|
|
||||||
if args.room == "shop":
|
if args.room == "shop":
|
||||||
dmx._rgbs = [
|
dmx._rgbs = [
|
||||||
|
|
@ -83,8 +83,6 @@ def main(args):
|
||||||
ZhennbyPar(dmx, 15),
|
ZhennbyPar(dmx, 15),
|
||||||
ZhennbyPar(dmx, 22),
|
ZhennbyPar(dmx, 22),
|
||||||
]
|
]
|
||||||
elif args.room == "defrag":
|
|
||||||
dmx._rgbs = [Entec6RGBW(dmx, 300 + i*4) for i in range(19)]
|
|
||||||
else:
|
else:
|
||||||
print(f"Unknown room {args.room}", file=sys.stderr)
|
print(f"Unknown room {args.room}", file=sys.stderr)
|
||||||
sys.exit(64)
|
sys.exit(64)
|
||||||
|
|
|
||||||
|
|
@ -76,33 +76,3 @@ input.button_color {
|
||||||
background-color: #ff00ff;
|
background-color: #ff00ff;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjustments for display in club assistant. hacky WIP but should fix most display problems.
|
|
||||||
TODO: better recognition than max-width, full design parity to ha/lovelace*/
|
|
||||||
@media only screen and (max-width: 600px) {
|
|
||||||
:root {
|
|
||||||
--bg-color: #1c1c1c;
|
|
||||||
--primary-color: #e1e1e1;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
width: 100%;
|
|
||||||
padding: 0px;
|
|
||||||
margin: 0px;
|
|
||||||
font-family: Roboto,Noto,sans-serif;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
.buttons {
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
.colors {
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
.controls {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue