Rename M117 macro

Is it possible to rename the M117 macro using “RENAME_EXISTING” ?

If I try to rename I got an error message “rename of different type”

I would like to enhance this macro to send the text also to the console like that:

[gcode_macro M117]
rename_existing: ORIGINAL_M117
description: displays message on the LCD and the console simultaneously
gcode:
ORIGINAL_M117 { params }
{% if params != “” %}
RESPOND PREFIX=“info” MSG="{ params }"
{% endif %}

Rename it to something of the same format like M117.0 or M999 …

I’m not sure this is possible, at least not without a way to parse the “traditional” (M117) params; with the override I get

// Unknown command:"M117.1 {'"info {'M': '117', 'PRIMING': ''}
// Unknown command:"M117.1 {'"info {'M': '117'}
!! Malformed command 'RESPOND PREFIX=info MSG="{'Z': ', #0', 'M': '117 0.2'}"'

The last one’s an error that aborts the print. Basically, serialization of the params dict is insufficient, and the dict is structured poorly for access by a macro.

Yeah - M117 is handled in a special way because it is unlike other g-code commands. So, I don’t know of a good way to rename it.

It should be possible to make your own “extended g-code” macro and call M117 from it though.

-Kevin

M118, too, right? Are there any others that use this special parsing?

M118 doesn’t have special handling today. The commands with special handling are in cmd_default() in klippy/gcode.py .

-Kevin