Remove invalid helper script from global package
- Remove script.get_mode_color which had incorrect response syntax - Replace with usage notes showing how to access mode colors in templates - Blueprints and automations access colors directly via templates - Fixes 'extra keys not allowed @ data['sequence'][0]['response']' error
This commit is contained in:
@@ -47,21 +47,8 @@ input_text:
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# HELPER SCRIPTS
|
# USAGE NOTES
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
# To access mode colors in templates:
|
||||||
script:
|
# {% set colors = states('input_text.adaptive_lighting_mode_colors') | from_json %}
|
||||||
get_mode_color:
|
# {{ colors.get('Reading', 170) }}
|
||||||
alias: "Get LED Color for Mode"
|
|
||||||
description: "Returns the LED color value (0-255) for a given mode name"
|
|
||||||
fields:
|
|
||||||
mode:
|
|
||||||
description: "Mode name (e.g., 'Reading', 'Sleep')"
|
|
||||||
example: "Reading"
|
|
||||||
sequence:
|
|
||||||
- stop: "Color retrieved"
|
|
||||||
response_variable: "color"
|
|
||||||
response:
|
|
||||||
color: >-
|
|
||||||
{% set colors = states('input_text.adaptive_lighting_mode_colors') | from_json %}
|
|
||||||
{{ colors.get(mode, 170) }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user