This commit is contained in:
2025-07-03 18:04:20 +03:00
parent b87714faef
commit 5bdc26e3fa

View File

@@ -10,18 +10,19 @@ gcode:
M119 M119
[delayed_gcode _FIRST_STAGE_IDLE] [delayed_gcode _FIRST_STAGE_IDLE]
variable_first_stage_active: False
gcode: gcode:
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %} {% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
{% if printer.heater_bed.temperature < 50.0 %} {% if printer.heater_bed.temperature < 50.0 %}
{% if printer.heater_bed.target == 0.0 %} {% if printer.heater_bed.target == 0.0 %}
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0 UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
{% if printer["gcode_macro RatOS"].powercheck == 0 %} {% if printer["gcode_macro _FIRST_STAGE_IDLE"].first_stage_active|lower == 'false' %}
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
RESPOND PREFIX=tgnotify MSG="Моторы погашены" RESPOND PREFIX=tgnotify MSG="Моторы погашены"
{% endif %} {% endif %}
M84 M84
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION={printer["gcode_macro RatOS"].poweroff_delay} UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION={printer["gcode_macro RatOS"].poweroff_delay}
SET_GCODE_VARIABLE MACRO=RatOS VARIABLE=powercheck VALUE=1 SET_GCODE_VARIABLE MACRO=_FIRST_STAGE_IDLE VARIABLE=first_stage_active VALUE=True
M104 S0 M104 S0
{% endif %} {% endif %}
{% else %} {% else %}
@@ -97,7 +98,7 @@ gcode:
[gcode_macro _POWER_OFF_PRINTER] [gcode_macro _POWER_OFF_PRINTER]
gcode: gcode:
SET_GCODE_VARIABLE MACRO=RatOS VARIABLE=powercheck VALUE=0 SET_GCODE_VARIABLE MACRO=_FIRST_STAGE_IDLE VARIABLE=first_stage_active VALUE=False
{action_call_remote_method("set_device_power", {action_call_remote_method("set_device_power",
device=printer["gcode_macro RatOS"].power_device, device=printer["gcode_macro RatOS"].power_device,
state="off")} state="off")}