-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimalist_yaml.yaml
160 lines (155 loc) · 4.88 KB
/
minimalist_yaml.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
card_media_player_sonos:
size: "20px"
show_icon: true
show_entity_picture: false
show_state: false
show_name: true
template:
- "green_playing"
- "icon_info_bg"
- "ulm_language_variables"
label: |
[[[
if (entity.state == 'idle'){
return variables.ulm_off;
}
if (entity.state == 'paused'){
return variables.ulm_paused;
}
if (entity.state == 'unavailable'){
return variables.ulm_unavailable;
} else {
return (entity.attributes.source ? entity.attributes.source : variables.ulm_playing)
+ ' • ' + ( Math.round(entity.attributes.volume_level / 0.01)) + '%' ;
}
]]]
card_media_player_sonos_art:
size: "20px"
show_icon: true
show_entity_picture: true
show_state: false
show_name: true
template:
- "icon_info_bg"
- "ulm_language_variables"
variables:
- ulm_card_sonos_use_entity_picture: "false"
styles:
icon:
- place-self: >
[[[
if (variables.ulm_card_sonos_use_entity_picture !== true){
return "center";
} else {
return "stretch stretch";
}
]]]
entity_picture:
- height: 40px
- width: 40px
icon: "mdi:play"
entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
name: "[[[ return states[entity.entity_id].attributes.media_title; ]]]"
label: "[[[ return states[entity.entity_id].attributes.media_artist; ]]]"
card_media_player_sonos_with_controls_art:
variables:
ulm_card_media_player_with_controls_name: "No name set"
triggers_update:
- "[[[ ulm_card_media_player_with_controls_entity ]]]"
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content min-content"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "list_2_items"
custom_fields:
item1:
card:
type: "custom:button-card"
template:
- "ulm_language_variables"
- "card_media_player_sonos"
tap_action:
action: "more-info"
entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
name: "[[[ return variables.ulm_card_media_player_with_controls_name ]]]"
styles:
card:
- box-shadow: "none"
- padding: "0px"
item2:
card:
type: "custom:button-card"
template:
- "ulm_language_variables"
- "card_media_player_sonos_art"
tap_action:
action: "more-info"
entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
styles:
card:
- box-shadow: "none"
- padding: "0px"
item2:
card:
type: "custom:button-card"
template: "list_items"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "media_player.volume_down"
service_data:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:volume-minus"
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
tap_action:
action: "call-service"
service: "media_player.media_play_pause"
service_data:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:pause"
state:
- value: "paused"
icon: "mdi:play"
- value: "off"
icon: "mdi:play"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "media_player.volume_up"
service_data:
entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]"
icon: "mdi:volume-plus"
green_playing:
state:
- styles:
icon:
- color: "rgba(var(--color-green),1)"
img_cell:
- background-color: "rgba(var(--color-green), 0.2)"
value: "playing"
entity_picture:
- height: 54px
- width: 54px
- border-radius: 100%