forked from rootiest/zippy-klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWLED.cfg
113 lines (93 loc) · 3.62 KB
/
WLED.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# WLED Configurations
[gcode_macro WLED_ON]
description: Turn WLED strip on using optional preset and resets led colors
gcode:
{% set strip = params.STRIP|default('Lighting')|string %}
{% set preset = params.PRESET|default(-1)|int %}
{action_call_remote_method("set_device_power",
device=strip,
state="on")}
{action_call_remote_method("set_wled_state",
strip=strip,
state=True,
preset=preset)}
[gcode_macro WLED_OFF]
description: Turn WLED strip off
gcode:
{% set strip = params.STRIP|default('Lighting')|string %}
SET_WLED STRIP={strip} RED=0 BLUE=0 GREEN=0
{action_call_remote_method("set_wled_state",
strip=strip,
state=False)}
{action_call_remote_method("set_device_power",
device=strip,
state="off")}
[gcode_macro WLED_CONTROL]
description: Control effect values and brightness
gcode:
{% set strip = params.STRIP|default('Lighting')|string %}
{% set brightness = params.BRIGHTNESS|default(-1)|int %}
{% set intensity = params.INTENSITY|default(-1)|int %}
{% set speed = params.SPEED|default(-1)|int %}
{action_call_remote_method("set_wled_state",
strip=strip,
brightness=brightness,
intensity=intensity,
speed=speed)}
[gcode_macro SET_WLED]
description: SET_LED like functionlity for WLED, applies to all active segments
gcode:
{% set strip = params.STRIP|default('Lighting')|string %}
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set index = params.INDEX|default(-1)|int %}
{% set transmit = params.TRANSMIT|default(1)|int %}
{action_call_remote_method("set_wled",
strip=strip,
red=red, green=green, blue=blue, white=white,
index=index, transmit=transmit)}
[gcode_macro WLED_DEFAULT]
description: Turn on WLED strip with default configuration
gcode:
{% set strip = 'Lighting' %}
{action_call_remote_method("set_device_power",
device=strip,
state="on")}
{action_call_remote_method("set_wled_state",
strip=strip,
state=True,
preset=1)}
# Sample accompanying moonraker config
# In moonraker.conf:
#
# [wled Lighting]
# type: http
# address: 192.168.86.48
# initial_preset: 1
# chain_count: 56
# WLED Print Progress
#
[gcode_macro _wled_print_progress]
gcode:
{% set PROGRESS = printer.display_status.progress|default(0)|float %}
WLED_CONTROL INTENSITY={PROGRESS*100}
#
# To use:
# Set WLED to a preset that supports progress visualization. Like "Percent"
# Add the following command to your slicer's New Layer Custom Gcode:
#
# _wled_print_progress
#
# Sample of a delayed_gcode initiated print progress updater
#
# [delayed_gcode _wled_print_progress]
# initial_duration: 120
# gcode:
# {% if printer.idle_timeout.state|lower == "printing" %}
# {% set PROGRESS = printer.display_status.progress|default(0)|float %}
# WLED_CONTROL INTENSITY={PROGRESS*100}
# {% endif %}
# # Repeat every 15 seconds:
# UPDATE_DELAYED_GCODE ID=_wled_print_progress DURATION=15