gcode_macro: Parse variable_X parameters using ast.literal_eval()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-06-07 19:30:17 -04:00
parent 01f3b50e73
commit 8b00580884
5 changed files with 32 additions and 14 deletions

View File

@@ -1454,11 +1454,11 @@
# the command invoking the macro.
#variable_<name>:
# One may specify any number of options with a "variable_" prefix.
# The given variable name will then be available during macro
# expansion. For example, a config with "variable_my_name = zebra"
# might have a gcode config containing "M117 My name is {my_name}".
# Variables can be changed at run-time using the SET_GCODE_VARIABLE
# command.
# The given variable name will be assigned the given value (parsed
# as a Python literal) and will be available during macro expansion.
# For example, a config with "variable_fan_speed = 75" might have
# gcode commands containing "M106 S{ fan_speed * 255 }". Variables
# can be changed at run-time using the SET_GCODE_VARIABLE command.
# Enable the "M118" and "RESPOND" extended commands.