diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-07 19:30:17 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-07 19:33:31 -0400 |
commit | 8b005808848dd5395792dba8b9f470ac441c5e72 (patch) | |
tree | d14322e6056d6652d3e15e77fb06698cdf588978 /test | |
parent | 01f3b50e7399f3ea327c6de2130dc16b6f8a27f5 (diff) | |
download | kutter-8b005808848dd5395792dba8b9f470ac441c5e72.tar.gz kutter-8b005808848dd5395792dba8b9f470ac441c5e72.tar.xz kutter-8b005808848dd5395792dba8b9f470ac441c5e72.zip |
gcode_macro: Parse variable_X parameters using ast.literal_eval()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/klippy/macros.cfg | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/klippy/macros.cfg b/test/klippy/macros.cfg index 4886425f..8124aa3a 100644 --- a/test/klippy/macros.cfg +++ b/test/klippy/macros.cfg @@ -80,13 +80,13 @@ gcode: {% endif %} [gcode_macro TEST_variable] -variable_t: 12 +variable_t: 12.0 gcode: { printer.gcode.action_respond_info("TEST_variable") } - {% if t|float - 12.0 != printer.toolhead.position.y %} + {% if t - 12.0 != printer.toolhead.position.y %} M112 {% endif %} - {% if printer["gcode_macro TEST_variable"].t|float - 12.0 != 0.0 %} + {% if printer["gcode_macro TEST_variable"].t - 12.0 != 0.0 %} M112 {% endif %} SET_GCODE_VARIABLE MACRO=TEST_variable VARIABLE=t VALUE=17 @@ -95,7 +95,7 @@ gcode: [gcode_macro TEST_variable_part2] gcode: { printer.gcode.action_respond_info("TEST_variable_part2") } - {% if printer["gcode_macro TEST_variable"].t|float != 17.0 %} + {% if printer["gcode_macro TEST_variable"].t != 17.0 %} M112 {% endif %} |