-
Notifications
You must be signed in to change notification settings - Fork 0
/
automation-2.9-dad-jokes.yaml
52 lines (52 loc) · 1.34 KB
/
automation-2.9-dad-jokes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
alias: EPaper Tags - API Ninjas - Dad Jokes
description: "Show a (not)funny 'dad' joke, every hour!"
trigger:
- platform: time_pattern
minutes: "7"
action:
- service: open_epaper_link.drawcustom
data:
background: white
rotate: 0
payload:
- type: icon
value: emoticon-lol
x: 1
"y": 1
size: 35
color: red
- type: icon
value: emoticon-confused
x: 260
"y": 92
size: 35
color: red
- type: text
value: "{{state_attr('sensor.api_ninja_dad_jokes','joke') | string }}"
font: ../../media/GothamRnd-Bold.ttf
x: 32
"y": 32
size: >-
{% set string_len = state_attr('sensor.api_ninja_dad_jokes','joke')
| length | int %} {% if string_len <= 50 %}
26
{% elif string_len <= 60 %}
20
{% elif string_len <= 100 %}
18
{% elif string_len <= 150 %}
15
{% elif string_len <= 200 %}
14
{% else %}
12
{% endif %}
color: black
anchor: lt
max_width: 232
y_padding: 0
spacing: 2
target:
entity_id:
- open_epaper_link.000002123456ABC
mode: restart