c_evening_daylight.cfg modified - 19/04/25 - 10:23:21

This commit is contained in:
pi committed 2025-04-19 10:23:25 +10:00
1 parent aa8aca4c3d
commit dc95b3aa4d
1 file changed
+3 -6
@@ -1,16 +1,13 @@
[gcode_shell_command GET_TIME]
command: sh /home/pi/printer_data/config/SCRIPTS/get_time.sh
timeout: 0.3
timeout: 0.05
verbose: False
[delayed_gcode process_time_output]
initial_duration: 0.25
gcode:
{% set output = printer["gcode_shell_command GET_TIME"].output %}
{% set parts = 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}
{% set debug_msg = "⏱ Stored hour=" ~ parts[0]|int|string ~ " min=" ~ parts[1]|int|string %}
RESPOND MSG="{debug_msg}"
RESPOND MSG="{output}" # just prints raw output
[gcode_macro SHOW_LIGHT_TIME]
gcode: