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:
Kevin O'Connor 2021-04-26 12:44:51 -04:00
parent 61a25d2fb2
commit d36dbfebd1
4 changed files with 32 additions and 60 deletions

View file

@ -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)