Closed datapaganism closed 2 years ago
Thanks for the contribution.
Please indent the {% if %} {% else %} {% endif %}
block with 2 spaces as well for consistency.
Is it safe to assume that printer.configfile.settings.bltouch.x_offset
or printer.configfile.config.bltouch
is always defined?
Finally: is it ok with you if I add you to the "Credits" section of the README.md?
I have double checked the Moonraker API that governs the printer object, printer.configfile.config
pulls data from printer.cfg
.
x_offset
and y_offset
must both be defined in one's printer.cfg
I have also added an else block to support other probe types however this is untested but should work.
And yes I don't mind being added to the credits section
Please add an {% else %}
branch setting both x_offset
and y_offset
to 0
(= zero). Else they are undefined, and the calculation below may fail. Alternatively you can initialize them before the first {% if %}
. Since people may just copy-and-paste this without knowing what it does it should be as resilient as possible.
Also, please correctly indent the following block for consistency:
{% set y = y - y_offset | float %}
{% set x = x - x_offset | float %}
It is outside anything, so only 2 spaces.
Thanks, indents always catch me out as you can see, I believe this is good enough now to be released
Merged. Will add you to the Credits shortly. Thanks again and happy printing.
Modified G30 macro to fix Issue 25