59 lines
2.2 KiB
INI
59 lines
2.2 KiB
INI
[idle_timeout]
|
|
timeout: 120
|
|
gcode:
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=printer["gcode_macro RatOS"].idle_delay
|
|
|
|
[delayed_gcode _FIRST_STAGE_IDLE]
|
|
gcode:
|
|
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
|
|
{% if printer.extruder.temperature < 50.0 and printer.heater_bed.temperature < 50.0 %}
|
|
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=printer["gcode_macro RatOS"].poweroff_delay
|
|
|
|
M84
|
|
{% else %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=2
|
|
{% endif %}
|
|
{% else %}
|
|
{% if printer.idle_timeout.state == "Printing" %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
|
|
{% else %}
|
|
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=2
|
|
{% else %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
[delayed_gcode _POWER_OFF_PRINTER_CHECK]
|
|
gcode:
|
|
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
|
|
{% if printer.extruder.temperature < 50.0 and printer.heater_bed.temperature < 50.0 %}
|
|
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
|
M84
|
|
{% else %}
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=2
|
|
{% endif %}
|
|
{% else %}
|
|
{% if printer.idle_timeout.state == "Printing" %}
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
|
{% else %}
|
|
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=2
|
|
{% else %}
|
|
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
[gcode_macro _POWER_OFF_PRINTER]
|
|
gcode:
|
|
{action_call_remote_method("set_device_power",
|
|
device=printer["gcode_macro RatOS"].power_device,
|
|
state="off")}
|