Skip to content

Commit

Permalink
Add icon (ID) and duration as parameters to Awtrix light.
Browse files Browse the repository at this point in the history
  • Loading branch information
dannytsang committed Oct 29, 2023
1 parent e57dee0 commit 9a72a40
Showing 1 changed file with 40 additions and 9 deletions.
49 changes: 40 additions & 9 deletions packages/integrations/awtrix_light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,48 @@ script:
alias: Send Bedroom Clock Notification
fields:
message:
description: Message to post
description: Message to post.
required: true
selector:
text:
multiline: true
icon:
description: Icon number to display.
selector:
number:
min: 1
max: 100
mode: box
duration:
description: Time in seconds to display the notification.
default: 10
selector:
number:
min: 1
max: 120
unit_of_measurement: secs
mode: box
sequence:
- service: mqtt.publish
data:
topic: "{{ states('sensor.bedroom_clock_device_topic')}}/notify"
payload_template: >-
"{
'text': '{{ message }}',
'duration': 5
}"
- if:
- condition: template
value_template: "{{ icon|default('', true)|length > 0 }}"
then:
- service: mqtt.publish
data:
topic: "{{ states('sensor.bedroom_clock_device_topic')}}/notify"
payload_template: >-
"{
'text': '{{ message }}',
'icon': '{{ icon }}'
'duration': {{ duration|default(10, true) }}
}"
else:
- service: mqtt.publish
data:
topic: "{{ states('sensor.bedroom_clock_device_topic')}}/notify"
payload_template: >-
"{
'text': '{{ message }}',
'duration': {{ duration|default(10, true) }}
}"
mode: single

0 comments on commit 9a72a40

Please sign in to comment.