forked from strayr/strayr-k-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbed_cooling_alarm.cfg
29 lines (24 loc) · 1.09 KB
/
bed_cooling_alarm.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[gcode_macro BED_COOLING_ALARM]
description: checks every 30 seconds to see if the bed is below a certain temperature
variable_target: 40
variable_cycles: 0
gcode:
{% set my_target = params.TARGET|default(target)|float %}
SET_GCODE_VARIABLE MACRO=BED_COOLING_ALARM VARIABLE=target VALUE={my_target}
{% if cycles < 1 %}
{ action_respond_info("Alarm will sound when bed cools to " + my_target|string +"C") }
{% endif %}
SET_GCODE_VARIABLE MACRO=BED_COOLING_ALARM VARIABLE=cycles VALUE={cycles + 1}
{% if printer.heater_bed.temperature < my_target %}
_SOUND_ALARM
{ action_respond_info("Bed has cooled below " + my_target|string +"C") }
#{ action_respond_info("Alarm performed " + cycles|string +" cycles") } #debug
SET_GCODE_VARIABLE MACRO=BED_COOLING_ALARM VARIABLE=target VALUE=40
SET_GCODE_VARIABLE MACRO=BED_COOLING_ALARM VARIABLE=cycles VALUE={0}
#TODO notify on LCD
{% else %}
UPDATE_DELAYED_GCODE ID=cooling_helper DURATION=30
{% endif %}
[delayed_gcode cooling_helper]
gcode:
BED_COOLING_ALARM