dotstar: report color data via get_status()

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan authored and KevinOConnor committed 2021-06-18 10:53:12 -04:00
1 parent 65afad9428
commit 7ced62ab9c
1 file changed
+9
+9
View File
@@ -82,6 +82,15 @@ class PrinterDotstar:
else:
#Send update now (so as not to wake toolhead and reset idle_timeout)
lookahead_bgfunc(None)
def get_status(self, eventtime):
cdata = []
for i in range(self.chain_count):
idx = (i + 1) * 4
cdata.append(
{k: round(v / 255., 4) for k, v in
zip("BGR", self.color_data[idx+1:idx+4])}
)
return {'color_data': cdata}
def load_config_prefix(config):
return PrinterDotstar(config)