docs: Prefer Jinja2 "set" directive to default_parameter_xxx in examples
The "set" directive is more flexible and easier to understand. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -30,13 +30,13 @@ i2c_bus: i2c.1
|
||||
htu21d_hold_master: False
|
||||
|
||||
[gcode_macro QUERY_ENCLOSURE]
|
||||
default_parameter_SENSOR: htu21d enclosure_temp
|
||||
gcode:
|
||||
{% set sensor = printer["htu21d enclosure_temp"] %}
|
||||
{action_respond_info(
|
||||
"Temperature: %.2f C\n"
|
||||
"Humidity: %.2f%%" % (
|
||||
printer[SENSOR].temperature,
|
||||
printer[SENSOR].humidity))}
|
||||
sensor.temperature,
|
||||
sensor.humidity))}
|
||||
|
||||
# Example 3:Using a pin on another gpiochip connected to the RPi
|
||||
# (in this case on an MCP23017)
|
||||
|
||||
Reference in New Issue
Block a user