Inconsistent case transformation in gcode variables
When declaring a gcode macro variable:
[gcode_macro MY_MACRO]
variable_MY_VARIABLE: 100
klipper automatically converts this to lower case. Dumping this from the printer object results in:
printer['gcode_macro MY_MACRO'].my_variable = 100
Its actually noted in the documentation that variables cannot contain upper case letters. The case of the macro name is preserved however. Attempting to set the variable as declared:
SET_GCODE_VARIABLE MACRO=MY_MACRO VARIABLE=MY_VARIABLE VALUE=2
Results in an error: !! Unknown gcode_macro variable 'MY_VARIABLE' because the case of the VARIABLE argument is not force to lowercase to match behavior at declaration time. Instead you have to do this:
SET_GCODE_VARIABLE MACRO=MY_MACRO VARIABLE=my_variable VALUE=2
This feels bewildering and inconsistent. The behavior for macro names doesn't match the behavior for variable names, so knowledge gained on one language feature breaks for the other. If you really mean whats in the documentation then I would like the declaration should throw an error: !! Variable 'MY_VARIABLE' has invalid upper case
Hello,
It looks like there hasn't been any recent updates on this Klipper github issue. If you created this issue and no longer consider it open, then please login to github and close the issue. Otherwise, if there is no further activity on this thread then it will be automatically closed in a few days.
Best regards,
~ Your friendly GitIssueBot
PS: I'm just an automated script, not a human being.