33 lines
909 B
Python
33 lines
909 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_lamps.py
|
|
|
|
Needs the USB Private port. smooth_smc_pad.py 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[1]
|
|
|
|
|
|
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"))
|
|
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()
|