display_status: Implement SET_DISPLAY_TEXT command

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-06-21 12:33:11 -04:00 committed by KevinOConnor
parent ae17b66a88
commit a431900f7f
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,9 @@ class DisplayStatus:
gcode = self.printer.lookup_object('gcode')
gcode.register_command('M73', self.cmd_M73)
gcode.register_command('M117', self.cmd_M117)
gcode.register_command(
'SET_DISPLAY_TEXT', self.cmd_SET_DISPLAY_TEXT,
desc=self.cmd_SET_DISPLAY_TEXT_help)
def get_status(self, eventtime):
progress = self.progress
if progress is not None and eventtime > self.expire_progress:
@ -39,6 +42,9 @@ class DisplayStatus:
def cmd_M117(self, gcmd):
msg = gcmd.get_raw_command_parameters() or None
self.message = msg
cmd_SET_DISPLAY_TEXT_help = "Set or clear the display message"
def cmd_SET_DISPLAY_TEXT(self, gcmd):
self.message = gcmd.get("MSG", None)
def load_config(config):
return DisplayStatus(config)