dotstar: report color data via get_status()

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-06-01 12:35:18 -04:00 committed by KevinOConnor
parent 65afad9428
commit 7ced62ab9c
1 changed files with 9 additions and 0 deletions

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)