forked from BurrPro/custom_card_bb_media_player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_card_bb_media_player.yaml
170 lines (163 loc) · 5.62 KB
/
custom_card_bb_media_player.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
161
162
163
164
165
166
167
168
169
170
---
card_bb_media_player:
size: "20px"
show_icon: true
show_entity_picture: false
show_state: false
show_name: true
template:
- "icon_info"
- "blue_not_unavailable"
- "ulm_translation_engine"
label: "[[[ return variables.ulm_translation_state_unit ]]]"
card_bb_media_player_with_controls:
variables:
ulm_card_bb_media_player_with_controls_name: "No name set"
ulm_card_bb_media_player_with_controls_source_entity: "No entity set"
ulm_card_bb_media_player_enable_collapse: true
ulm_card_bb_media_player_controls: true
ulm_card_bb_media_player_enable_background_color: true
ulm_card_bb_media_player_with_controls_source_sensor_entity: "No entity set"
triggers_update:
- "[[[ ulm_card_bb_media_player_with_controls_entity ]]]"
styles:
grid:
- grid-template-areas: "'item1' 'item2' 'item3'"
- 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:
- "card_bb_media_player"
tap_action:
action: "call-service"
service: "input_select.select_option"
service_data:
entity_id: "[[[ return variables.ulm_card_bb_media_player_with_controls_source_entity ]]]"
option: "Off"
entity: "[[[ return variables.ulm_card_bb_media_player_with_controls_entity ]]]"
name: "[[[ return variables.ulm_card_bb_media_player_with_controls_name ]]]"
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: "input_select.select_option"
service_data:
entity_id: "[[[ return variables.ulm_card_bb_media_player_with_controls_source_entity ]]]"
option: "PS3"
icon: "mdi:sony-playstation"
item2:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "input_select.select_option"
service_data:
entity_id: "[[[ return variables.ulm_card_bb_media_player_with_controls_source_entity ]]]"
option: "Music"
icon: "mdi:music"
item3:
card:
type: "custom:color-card"
entity: "media_player.home_hifi"
tap_action:
action: "call-service"
service: "input_select.select_option"
service_data:
entity_id: "[[[ return variables.ulm_card_bb_media_player_with_controls_source_entity ]]]"
option: "Apple TV"
icon: "fapro:apple-tv-clean"
# item3:
# card:
# type: "custom:button-card"
# template: "widget_icon"
# entity: "media_player.home_hifi"
# tap_action:
# action: "call-service"
# service: "input_select.select_option"
# service_data:
# entity_id: "[[[ return variables.ulm_card_bb_media_player_with_controls_source_entity ]]]"
# option: "Apple TV"
# icon: "fapro:apple-tv-clean"
# card_mod:
# style: |
# ha-card {
# background:
# {% if states.ulm_card_bb_media_player_with_controls_source_sensor_entity.state == 'Apple TV' %}
# teal
# {% else %}
# purple
# {% endif %}
# ;
# }
item3:
card:
type: "custom:my-slider"
entity: "[[[return variables.ulm_card_bb_media_player_with_controls_entity ]]]"
radius: "14px"
title: "Volume"
height: "42px"
mainSliderColor: |
[[[
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? 'rgba(0, 0, 0, 0.2)'
: 'rgba(var(--color-blue),1)'
]]]
secondarySliderColor: |
[[[
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? 'rgba(0, 0, 0, 0.1)'
: 'rgba(var(--color-blue),0.2)'
]]]
mainSliderColorOff: "rgba(var(--color-theme),0.05)"
SecondarySliderColorOff: "rgba(var(--color-theme),0.05)"
thumbHorizontalPadding: "0px"
thumbVerticalPadding: "0px"
thumbWidth: "0px"
card_mod:
style: |
ha-card {
border-radius: 14px;
background-color: transparent;
box-shadow: none;
}
custom:
color-card:
style: |
ha-card {
background:
{% if states.sensor.bedroom_avr_source.state == 'Apple TV' %}
teal
{% else %}
purple
{% endif %}
;
}
blue_not_unavailable:
state:
- styles:
icon:
- color: "rgba(var(--color-blue),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
value: "unavailable"
operator: "!="