add missing colour change triggers

This commit is contained in:
sitting.duc@gmail.com 2021-03-19 22:12:02 +13:00 committed by SittingDuc
parent 02ef8dc973
commit 4bf734994a

View File

@ -139,7 +139,7 @@ variables:
xpos: 0 xpos: 0
iconwidth: 65 iconwidth: 65
iconheight: 65 iconheight: 65
iconfont: 8 iconfont: 7
xcen: 1 xcen: 1
ycen: 1 ycen: 1
activepage: >- activepage: >-
@ -272,7 +272,7 @@ action:
data: data:
topic: "{{jsoncommandtopic}}" topic: "{{jsoncommandtopic}}"
payload: >- payload: >-
["{{haspobject}}.font={{font}}", ["{{haspobject}}.font={{iconfont}}",
"{{haspobject}}.xcen={{xcen}}", "{{haspobject}}.xcen={{xcen}}",
"{{haspobject}}.ycen={{ycen}}", "{{haspobject}}.ycen={{ycen}}",
"{{haspobject}}.pco={{selectedfg}}", "{{haspobject}}.pco={{selectedfg}}",
@ -293,3 +293,51 @@ action:
["{{haspobject}}.pco={{selectedfg}}", ["{{haspobject}}.pco={{selectedfg}}",
"{{haspobject}}.font={{font}}", "{{haspobject}}.font={{font}}",
"{{haspobject}}.txt=\"{{icon}} \""] "{{haspobject}}.txt=\"{{icon}} \""]
#########################################################################
# Catch triggers fired by incoming MQTT messages
- conditions:
- condition: template
value_template: '{{ trigger.platform == "mqtt" }}'
sequence:
- choose:
#########################################################################
# Theme: Apply selected foreground color when it changes.
# Any change to the button will remove the overlaid icon.
- conditions:
- condition: template
value_template: "{{ trigger.topic == selectedfgtopic }}"
sequence:
- service: mqtt.publish
data:
topic: "{{commandtopic}}.pco"
payload: "{{trigger.payload}}"
#########################################################################
# Theme: Apply selected background color on change
- conditions:
- condition: template
value_template: "{{ trigger.topic == selectedbgtopic }}"
sequence:
- service: mqtt.publish
data:
topic: "{{commandtopic}}.bco"
payload: "{{trigger.payload}}"
#########################################################################
# Theme: Apply unselected foreground color on change
- conditions:
- condition: template
value_template: "{{ trigger.topic == unselectedfgtopic }}"
sequence:
- service: mqtt.publish
data:
topic: "{{commandtopic}}.pco2"
payload: "{{trigger.payload}}"
#########################################################################
# Theme: Apply unselected background color on change
- conditions:
- condition: template
value_template: "{{ trigger.topic == unselectedbgtopic }}"
sequence:
- service: mqtt.publish
data:
topic: "{{commandtopic}}.bco2"
payload: "{{trigger.payload}}"