scripts.yaml, zigbee2mqtt/state.json
This commit is contained in:
+3
-5
@@ -262,11 +262,9 @@ spoolman_set_spool_remaining:
|
||||
sequence:
|
||||
- variables:
|
||||
resolved_id: '{% set n = (slot | int(0)) if slot is defined else 0 %}{% if n
|
||||
>= 1 %}{% set color = states(''sensor.sparkx_i7_cfs_box_1_slot_'' ~ (n | int)
|
||||
~ ''_color'') | replace(''#'', '''') | lower %}{% set ns = namespace(id='''')
|
||||
%}{% for e in integration_entities(''spoolman'') %}{% if e.endswith(''_color_hex'')
|
||||
and (states(e) | replace(''#'', '''') | lower) == color and (state_attr(e[:-10],
|
||||
''location'') | default('''', true) | lower) == ''cfs lite'' and ns.id ==
|
||||
>= 1 %}{% set ns = namespace(id='''') %}{% for e in integration_entities(''spoolman'')
|
||||
%}{% if e.endswith(''_color_hex'') and (state_attr(e[:-10], ''location'') |
|
||||
default('''', true) | lower) == (''cfs lite '' ~ (n | int)) and ns.id ==
|
||||
'''' %}{% set ns.id = states(e[:-10] ~ ''_id'') %}{% endif %}{% endfor %}{{
|
||||
ns.id }}{% else %}{{ (spool_id | int(0)) if spool_id is defined else 0 }}{%
|
||||
endif %}'
|
||||
|
||||
Reference in New Issue
Block a user