aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2021-01-21 19:31:09 -0500
committerKevinOConnor <kevin@koconnor.net>2021-06-18 10:53:12 -0400
commit65afad94281cc421b649e32575683c545502c7be (patch)
tree05960a28d712209e34e8d281090ed96e2ef188c9
parente520fb78782f7148123fd26dfc9511313d016111 (diff)
downloadkutter-65afad94281cc421b649e32575683c545502c7be.tar.gz
kutter-65afad94281cc421b649e32575683c545502c7be.tar.xz
kutter-65afad94281cc421b649e32575683c545502c7be.zip
neopixel: report color data via get_status() method
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
-rw-r--r--klippy/extras/neopixel.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/klippy/extras/neopixel.py b/klippy/extras/neopixel.py
index 1af0def4..481f8825 100644
--- a/klippy/extras/neopixel.py
+++ b/klippy/extras/neopixel.py
@@ -136,6 +136,16 @@ class PrinterNeoPixel:
else:
#Send update now (so as not to wake toolhead and reset idle_timeout)
lookahead_bgfunc(None)
+ def get_status(self, eventtime):
+ cdata = []
+ elem_size = len(self.color_order)
+ for i in range(self.chain_count):
+ idx = i * elem_size
+ cdata.append(
+ {k: round(v / 255., 4) for k, v in
+ zip(self.color_order, self.color_data[idx:idx+elem_size])}
+ )
+ return {'color_data': cdata}
def load_config_prefix(config):
return PrinterNeoPixel(config)