修复休眠模式下关机流程不对问题
This commit is contained in:
parent
f806fa6b43
commit
8e870f15e6
@ -58,6 +58,9 @@ pin: ^!gpiochip4/gpio19
|
||||
debounce_period: .01
|
||||
minimum_event_time: 0
|
||||
on_press:
|
||||
{% set server_info = call_method("server.info") %}
|
||||
{% set server_info_data = server_info | tojson | fromjson %}
|
||||
{% if server_info_data['klippy_state'] == "ready" %}
|
||||
{% set query_objs = {"print_stats": ["state"], "toolhead": ["extruder"], "gcode_move": ["gcode_position"], "virtual_sdcard": ["file_path"]} %}
|
||||
{% set status = call_method("printer.objects.query", objects=query_objs) %}
|
||||
{% do call_method("printer.emergency_stop") %}
|
||||
@ -90,6 +93,7 @@ on_press:
|
||||
{% else %}
|
||||
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False") %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
# shutdown
|
||||
{% do call_method("machine.shutdown") %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user