aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-03-23 18:06:09 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-03-31 13:08:12 -0400
commit1ab3ac39e410441190690d43f6d2ef339f23a155 (patch)
treef1be1eab0194a7f6539a7cb16926fbf687750997 /docs
parenta6ab56c0a6c7c532f1f1e2b5b5b4060cea7001a5 (diff)
downloadkutter-1ab3ac39e410441190690d43f6d2ef339f23a155.tar.gz
kutter-1ab3ac39e410441190690d43f6d2ef339f23a155.tar.xz
kutter-1ab3ac39e410441190690d43f6d2ef339f23a155.zip
led: Support automated LED updates based on display_template results
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'docs')
-rw-r--r--docs/Config_Reference.md24
-rw-r--r--docs/G-Codes.md17
2 files changed, 32 insertions, 9 deletions
diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md
index 1b264801..c62d4274 100644
--- a/docs/Config_Reference.md
+++ b/docs/Config_Reference.md
@@ -3552,12 +3552,18 @@ text:
### [display_template]
Display data text "macros" (one may define any number of sections with
-a display_template prefix). This feature allows one to reduce
-repetitive definitions in display_data sections. One may use the
-builtin render() function in display_data sections to evaluate a
-template. For example, if one were to define `[display_template
-my_template]` then one could use `{ render('my_template') }` in a
-display_data section.
+a display_template prefix). See the
+[command templates](Command_Templates.md) document for information on
+template evaluation.
+
+This feature allows one to reduce repetitive definitions in
+display_data sections. One may use the builtin `render()` function in
+display_data sections to evaluate a template. For example, if one were
+to define `[display_template my_template]` then one could use `{
+render('my_template') }` in a display_data section.
+
+This feature can also be used for continuous LED updates using the
+[SET_LED_TEMPLATE](G-Codes.md#set_led_template) command.
```
[display_template my_template_name]
@@ -3570,9 +3576,9 @@ display_data section.
# "param_speed = 75" might have a caller with
# "render('my_template_name', param_speed=80)". Parameter names may
# not use upper case characters.
-#text:
-# The text to return when the render() function is called for this
-# template. This field is evaluated using command templates (see
+text:
+# The text to return when the this template is rendered. This field
+# is evaluated using command templates (see
# docs/Command_Templates.md). This parameter must be provided.
```
diff --git a/docs/G-Codes.md b/docs/G-Codes.md
index dbfd0b85..bef64dc4 100644
--- a/docs/G-Codes.md
+++ b/docs/G-Codes.md
@@ -714,6 +714,23 @@ timeout. If careful timing is not needed, the optional SYNC=0
parameter can be specified to apply the changes without resetting the
idle timeout.
+#### SET_LED_TEMPLATE
+`SET_LED_TEMPLATE LED=<led_name> TEMPLATE=<template_name>
+[INDEX=<index>]`: Assign a
+[display_template](Config_Reference.md#display_template) to a given
+[LED](Config_Reference.md#leds). For example, if one defined a
+`[display_template my_led_template]` config section then one could
+assign `TEMPLATE=my_led_template` here. The display_template should
+produce a comma separated string containing four floating point
+numbers corresponding to red, green, blue, and white color settings.
+The template will be continuously evaluated and the LED will be
+automatically set to the resulting colors. If INDEX is not specified
+then all chips in the LED's daisy-chain will be set to the template,
+otherwise only the chip with the given index will be updated. If
+TEMPLATE is an empty string then this command will clear any previous
+template assigned to the LED (one can then use `SET_LED` commands to
+manage the LED's color settings).
+
### [output_pin]
The following command is available when an