aboutsummaryrefslogtreecommitdiff
path: root/NeoRuntime/Runtime/luxcena_neo/strip.py
diff options
context:
space:
mode:
authorjakob.stendahl <jakob.stendahl@infomedia.dk>2022-12-04 13:33:45 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2022-12-04 13:34:22 +0100
commitc3b4742eeceee9250f8059972dd150f38e2eb021 (patch)
treeedde9ea65b554ff345788a916f238aed4a772b35 /NeoRuntime/Runtime/luxcena_neo/strip.py
parentc5dc2dfb92e4a6584d1e727bc39b8c9578f85b57 (diff)
downloadLuxcena-Neo-c3b4742eeceee9250f8059972dd150f38e2eb021.tar.gz
Luxcena-Neo-c3b4742eeceee9250f8059972dd150f38e2eb021.zip
Fix simulation stuttering (still resource intensive) and some oter QOL upgrades
Diffstat (limited to 'NeoRuntime/Runtime/luxcena_neo/strip.py')
-rw-r--r--NeoRuntime/Runtime/luxcena_neo/strip.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/NeoRuntime/Runtime/luxcena_neo/strip.py b/NeoRuntime/Runtime/luxcena_neo/strip.py
index 0d23069..aa5b2d2 100644
--- a/NeoRuntime/Runtime/luxcena_neo/strip.py
+++ b/NeoRuntime/Runtime/luxcena_neo/strip.py
@@ -1,9 +1,27 @@
import json
from os import path
-import rpi_ws281x as ws
from .matrix import Matrix, get_segment_range
from .power_calc import calcCurrent
+""" import rpi_ws281x library, or import dummy version. """
+try:
+ import rpi_ws281x as ws
+except ModuleNotFoundError:
+ """ Dummy STRIP used for debugging purposes """
+ class STRIP:
+ def __init__(self, *args, **kwargs): pass
+ def begin(self, *args): pass
+ def blank(self): pass
+ def show(self): pass
+ def setPixelColor(self, *args): pass
+ def setBrightness(self, *args): pass
+ """ Dummy ws implementation """
+ class WS:
+ WS2812_STRIP = 1
+ Adafruit_NeoPixel = STRIP
+ def __init__(*args): print("rpi_ws281x is not installed, using a dummy module")
+ ws = WS()
+
class Strip: