Commit 98cef37e authored by Fjen Undso's avatar Fjen Undso
Browse files

hotkeys with shift

parent b1ea2f3e
...@@ -10,6 +10,9 @@ from gui.progressbar import ProgressBar ...@@ -10,6 +10,9 @@ from gui.progressbar import ProgressBar
from gui.container.focusswitcher import FocusSwitcher from gui.container.focusswitcher import FocusSwitcher
from gui.container.numberbar import NumberBarContainer from gui.container.numberbar import NumberBarContainer
PIXEL_COUNT = 42
IP_ADDRESS = "10.0.0.255"
class NCHL: class NCHL:
fs_main = None fs_main = None
...@@ -21,8 +24,8 @@ class NCHL: ...@@ -21,8 +24,8 @@ class NCHL:
def __init__(self, screen): def __init__(self, screen):
self.screen = screen self.screen = screen
self.logger = logging.getLogger(__name__) self.logger = logging.getLogger(__name__)
self.strips = [LEDStrip(host_id=i) for i in range(1, 9)] self.strips = [LEDStrip(host_id=i, pixel_count=PIXEL_COUNT, address=IP_ADDRESS) for i in range(1, 9)]
self.strips_all = LEDStrip() self.strips_all = LEDStrip(pixel_count=PIXEL_COUNT, address=IP_ADDRESS)
# hide cursor # hide cursor
curses.curs_set(0) curses.curs_set(0)
...@@ -127,13 +130,13 @@ class NCHL: ...@@ -127,13 +130,13 @@ class NCHL:
window=self.screen, window=self.screen,
col=scr_center_x - 12, col=scr_center_x - 12,
row=18, row=18,
toggle_key_unfocused="c", toggle_key_unfocused="C",
text="(c)ontinuous updating", text="(C)ontinuous updating",
) )
self.screen.addstr( self.screen.addstr(
19, 19,
scr_center_x - 20, scr_center_x - 20,
"(s)end | all (o)ff | all (w)hite | (q)uit", "(S)end | all (O)ff | all (W)hite | (Q)uit",
curses.color_pair(curses.COLOR_YELLOW), curses.color_pair(curses.COLOR_YELLOW),
) )
...@@ -153,21 +156,21 @@ class NCHL: ...@@ -153,21 +156,21 @@ class NCHL:
self.fs_main.send_key(k) self.fs_main.send_key(k)
# quit # quit
if k == "q": if k == "Q":
break break
# all off: # all off:
if k == "o": if k == "O":
self.strips_all.set_all([0] * 4) self.strips_all.set_all([0] * 4)
self.strips_all.send() self.strips_all.send()
continue continue
# all white # all white
if k == "w": if k == "W":
self.strips_all.set_all([0, 255, 100, 255]) self.strips_all.set_all([0, 255, 100, 255])
self.strips_all.send() self.strips_all.send()
continue continue
# send values to ESPs # send values to ESPs
if k == "s" or self.continous.active: if k == "S" or self.continous.active:
color = [self.numbers[i].value for i in range(1, 4)] color = [self.numbers[i].value for i in range(0, 4)]
for e in self.checkboxes_top + self.checkboxes_bottom: for e in self.checkboxes_top + self.checkboxes_bottom:
if e.active: if e.active:
self.strips[e.name].set_all(color) self.strips[e.name].set_all(color)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment