c_evening_daylight.cfg modified - 19/04/25 - 00:35:43
This commit is contained in:
1 parent
6630bdf808
commit
7415e132e7
1 file changed
+10
-4
@@ -1,17 +1,23 @@
|
||||
[gcode_shell_command GET_TIME]
|
||||
command: /home/pi/printer_data/config/SCRIPTS/get_time.sh
|
||||
timeout: 2.0
|
||||
timeout: 1.5
|
||||
|
||||
[delayed_gcode process_time_output]
|
||||
initial_duration: 1
|
||||
gcode:
|
||||
{% set parts = printer["shell_command"].output.split(" ") %}
|
||||
SET_GCODE_VARIABLE MACRO=EVENING_DAYLIGHT VARIABLE=hour VALUE={parts[0]|int}
|
||||
SET_GCODE_VARIABLE MACRO=EVENING_DAYLIGHT VARIABLE=minute VALUE={parts[1]|int}
|
||||
|
||||
[gcode_macro FETCH_TIME]
|
||||
gcode:
|
||||
RUN_SHELL_COMMAND GET_TIME
|
||||
{% set parts = shell_command_output.split(" ") %}
|
||||
SET_GCODE_VARIABLE MACRO=EVENING_DAYLIGHT VARIABLE=hour VALUE={parts[0]|int}
|
||||
SET_GCODE_VARIABLE MACRO=EVENING_DAYLIGHT VARIABLE=minute VALUE={parts[1]|int}
|
||||
UPDATE_DELAYED_GCODE ID=process_time_output DURATION=1
|
||||
|
||||
[gcode_macro CHECK_AND_FADE_LIGHT]
|
||||
gcode:
|
||||
FETCH_TIME
|
||||
G4 P1500 # wait 1.5s to ensure time vars are ready
|
||||
EVENING_DAYLIGHT
|
||||
|
||||
[gcode_macro EVENING_DAYLIGHT]
|
||||
|
||||
Reference in new issue
Block a user