Files
qlcplus/scripts/pad/pad_lamps.py
T

33 lines
923 B
Python

#!/usr/bin/env python3
"""Set the SMC-PAD lamps: bank 1 off, bank 2 in the colours of shows/test.qxw.
.venv/bin/python scripts/pad/pad_lamps.py
Needs the USB Private port. padeditor.intercept does this on start; run this
when the pad is read by Chataigne instead.
"""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def set_lamps() -> None:
"""Bank 1 lamps off, bank 2 lamps from shows/test.qxw. Needs the USB Private port."""
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(ROOT / "scripts" / "pad"))
import pad_colours
try:
pad_colours.apply(True, bank=1)
pad_colours.apply(False, bank=2, colours=pad_colours.colour_set())
except (SystemExit, Exception) as exc: # the Bluetooth link has no Private port
print(f"Lamps not set: {exc}", flush=True)
if __name__ == "__main__":
set_lamps()