diff options
author | Arksine <arksine.code@gmail.com> | 2021-01-21 19:31:09 -0500 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2021-06-18 10:53:12 -0400 |
commit | 65afad94281cc421b649e32575683c545502c7be (patch) | |
tree | 05960a28d712209e34e8d281090ed96e2ef188c9 /klippy/extras | |
parent | e520fb78782f7148123fd26dfc9511313d016111 (diff) | |
download | kutter-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>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/neopixel.py | 10 |
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) |