c_evening_daylight.cfg modified - 19/04/25 - 10:55:10
This commit is contained in:
1 parent
c84e8d23c3
commit
9ec6591f66
1 file changed
+2
-33
@@ -1,39 +1,8 @@
|
||||
[gcode_shell_command GET_TIME]
|
||||
command: sh /home/pi/printer_data/config/SCRIPTS/get_time.sh
|
||||
timeout: 0.05
|
||||
verbose: False
|
||||
|
||||
[gcode_macro FETCH_TIME]
|
||||
gcode:
|
||||
RUN_SHELL_COMMAND CMD=GET_TIME
|
||||
|
||||
[delayed_gcode process_time_output]
|
||||
initial_duration: 0.25
|
||||
gcode:
|
||||
{% set output = printer["shell_command"].output %}
|
||||
{% set parts = output.split(" ") %}
|
||||
SET_GCODE_VARIABLE MACRO=TIME_STATE VARIABLE=hour VALUE={parts[0]|int}
|
||||
SET_GCODE_VARIABLE MACRO=TIME_STATE VARIABLE=minute VALUE={parts[1]|int}
|
||||
|
||||
[gcode_macro CHECK_AND_FADE_LIGHT]
|
||||
gcode:
|
||||
FETCH_TIME
|
||||
UPDATE_DELAYED_GCODE ID=process_time_output DURATION=0.25
|
||||
G4 P500
|
||||
EVENING_DAYLIGHT
|
||||
|
||||
[gcode_macro SHOW_LIGHT_TIME]
|
||||
gcode:
|
||||
{% set hour = printer["gcode_macro EVENING_DAYLIGHT"].hour %}
|
||||
{% set minute = printer["gcode_macro EVENING_DAYLIGHT"].minute %}
|
||||
{% set msg = "🕒 Stored time: " ~ hour|string ~ ":" ~ ("%02d"|format(minute)) %}
|
||||
RESPOND MSG="{msg}"
|
||||
|
||||
[gcode_macro EVENING_DAYLIGHT]
|
||||
variable_hour: 0
|
||||
variable_minute: 0
|
||||
variable_last_brightness: -1.0
|
||||
gcode:
|
||||
{% set hour = printer["real_time"].hour %}
|
||||
{% set minute = printer["real_time"].minute %}
|
||||
{% set total_minutes = hour * 60 + minute %}
|
||||
{% set fade_out_start = 7 * 60 %}
|
||||
{% set fade_out_end = 8 * 60 %}
|
||||
|
||||
Reference in new issue
Block a user