Don't display any message if setting is empty

Contributes to issue CURA-6759.
This commit is contained in:
Ghostkeeper 2019-09-06 12:42:15 +02:00
parent c1b4bcebec
commit b20e5bfd98
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -114,9 +114,9 @@ class PauseAtHeight(Script):
"display_text":
{
"label": "Display Text",
"description": "Text that should appear on the display while paused.",
"description": "Text that should appear on the display while paused. If left empty, there will not be any message.",
"type": "str",
"default_value": "Print paused."
"default_value": ""
}
}
}"""
@ -295,7 +295,8 @@ class PauseAtHeight(Script):
# Set extruder standby temperature
prepend_gcode += self.putValue(M = 104, S = standby_temperature) + " ; standby temperature\n"
prepend_gcode += "M117 " + display_text + "\n"
if display_text:
prepend_gcode += "M117 " + display_text + "\n"
# Wait till the user continues printing
prepend_gcode += self.putValue(M = 0) + " ; Do the actual pause\n"