Motion lights outside the G-code queue (extras/motion_lights.py)

The AM312 case light and nozzle LEDs waited for long commands (heat waits,
AFC loads, QGL) because [gcode_button] runs through the G-code queue. The
new module reads the pin itself, keeps the timeout on a reactor timer and
sets the case light with output_pin's send_async_request and the nozzle
LEDs directly on the led_effect object. CASELIGHT and _LIGHTS_ON keep
working; _STATUS_SHOW reads printer.motion_lights.near.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-11-02 00:35:26 +01:00
1 parent 55b04a7cef
commit f25f348d0b
4 files changed
+269 -100

No files matched your search

+2 -2
View File
@@ -172,7 +172,7 @@ layers:
## nozzle effect ##
###################
# Switched by _LIGHTS (sensors/motion_sensor.cfg)
# Switched by [motion_lights] (sensors/motion_sensor.cfg, extras/motion_lights.py)
[led_effect sb_nozzle_light]
autostart: false
frame_rate: 12
@@ -218,7 +218,7 @@ description: Show STATE on the logo without storing it as the current status
gcode:
{% set state = params.STATE|lower %}
{% set cfg = printer['gcode_macro _STATUS'] %}
{% set near = printer['gcode_macro _LIGHTS'].near if 'gcode_macro _LIGHTS' in printer else True %}
{% set near = printer.motion_lights.near if 'motion_lights' in printer else True %}
{% set night = state == 'ready' and not near %}
{% set cool = printer.heater_bed.temperature < cfg.part_ready_temp %}
{% if state == 'ready' %}