Skip to content

Commit 7abb1ce

Browse files
authored
Merge pull request #981 from UI-Lovelace-Minimalist/release
Release v1.1.3
2 parents b97aa93 + 8ca14a2 commit 7abb1ce

22 files changed

+580
-244
lines changed

custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml

+75-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ ulm_actions_card:
1818
if (action == 'adaptive'){
1919
action = 'call-service'
2020
}
21-
21+
if (domain == "media_player" && action == 'toggle'){
22+
action = 'call-service';
23+
}
2224
if (action == 'popup' && (variables.ulm_custom_popup != null )){
2325
let popup_config = variables.ulm_custom_popup;
2426
if ((typeof popup_config === 'object') && 'template' in popup_config) {
@@ -41,7 +43,9 @@ ulm_actions_card:
4143
if (action == 'adaptive'){
4244
return 'input_select.select_option';
4345
}
44-
46+
if(entity.entity_id.startsWith("media_player.")){
47+
return 'media_player.media_play_pause';
48+
}
4549
return variables.ulm_card_tap_service;
4650
]]]
4751
service_data: >
@@ -54,19 +58,35 @@ ulm_actions_card:
5458
'entity_id': variables.ulm_input_select
5559
};
5660
}
57-
61+
if(entity.entity_id.startsWith("media_player.")){
62+
return {
63+
'entity_id': entity.entity_id
64+
};
65+
}
5866
return variables.ulm_card_tap_service_data;
5967
]]]
6068
browser_mod:
6169
service: "browser_mod.popup"
6270
data:
63-
large: true
6471
hide_header: true
6572
style: |
6673
--popup-background-color: var(--primary-background-color);
67-
--popup-border-radius: 0px;
74+
--popup-border-radius: 20px;
6875
--popup-padding-x: 24px;
6976
--popup-padding-y: 20px;
77+
--popup-max-width: auto
78+
--popup-min-width: 800px;
79+
card_mod:
80+
style:
81+
ha-dialog$: |
82+
@media (max-width: 800px){
83+
div.mdc-dialog__container {
84+
--mdc-dialog-min-width: 100vw;
85+
--mdc-dialog-max-width: 100vw;
86+
--mdc-dialog-min-height: 100%;
87+
--ha-dialog-border-radius: 0px;
88+
}
89+
}
7090
content:
7191
type: "custom:button-card"
7292
template: >
@@ -116,7 +136,9 @@ ulm_actions_card:
116136
if (action == 'adaptive'){
117137
action = 'call-service'
118138
}
119-
139+
if (domain == "media_player" && action == 'toggle'){
140+
action = 'call-service';
141+
}
120142
if (action == 'popup' && (variables.ulm_custom_popup != null )){
121143
let popup_config = variables.ulm_custom_popup;
122144
if ((typeof popup_config === 'object') && 'template' in popup_config) {
@@ -139,7 +161,9 @@ ulm_actions_card:
139161
if (action == 'adaptive'){
140162
return 'input_select.select_option';
141163
}
142-
164+
if(entity.entity_id.startsWith("media_player.")){
165+
return 'media_player.media_play_pause';
166+
}
143167
return variables.ulm_card_hold_service;
144168
]]]
145169
service_data: >
@@ -152,19 +176,35 @@ ulm_actions_card:
152176
'entity_id': variables.ulm_input_select
153177
};
154178
}
155-
179+
if(entity.entity_id.startsWith("media_player.")){
180+
return {
181+
'entity_id': entity.entity_id
182+
};
183+
}
156184
return variables.ulm_card_hold_service_data;
157185
]]]
158186
browser_mod:
159187
service: "browser_mod.popup"
160188
data:
161-
large: true
162189
hide_header: true
163190
style: |
164191
--popup-background-color: var(--primary-background-color);
165-
--popup-border-radius: 0px;
192+
--popup-border-radius: 20px;
166193
--popup-padding-x: 24px;
167194
--popup-padding-y: 20px;
195+
--popup-max-width: auto
196+
--popup-min-width: 800px;
197+
card_mod:
198+
style:
199+
ha-dialog$: |
200+
@media (max-width: 800px){
201+
div.mdc-dialog__container {
202+
--mdc-dialog-min-width: 100vw;
203+
--mdc-dialog-max-width: 100vw;
204+
--mdc-dialog-min-height: 100%;
205+
--ha-dialog-border-radius: 0px;
206+
}
207+
}
168208
content:
169209
type: "custom:button-card"
170210
template: >
@@ -214,7 +254,9 @@ ulm_actions_card:
214254
if (action == 'adaptive'){
215255
action = 'call-service'
216256
}
217-
257+
if (domain == "media_player" && action == 'toggle'){
258+
action = 'call-service';
259+
}
218260
if (action == 'popup' && (variables.ulm_custom_popup != null )){
219261
let popup_config = variables.ulm_custom_popup;
220262
if ((typeof popup_config === 'object') && 'template' in popup_config) {
@@ -237,7 +279,9 @@ ulm_actions_card:
237279
if (action == 'adaptive'){
238280
return 'input_select.select_option';
239281
}
240-
282+
if(entity.entity_id.startsWith("media_player.")){
283+
return 'media_player.media_play_pause';
284+
}
241285
return variables.ulm_card_double_tap_service;
242286
]]]
243287
service_data: >
@@ -250,19 +294,35 @@ ulm_actions_card:
250294
'entity_id': variables.ulm_input_select
251295
};
252296
}
253-
297+
if(entity.entity_id.startsWith("media_player.")){
298+
return {
299+
'entity_id': entity.entity_id
300+
};
301+
}
254302
return variables.ulm_card_double_tap_service_data;
255303
]]]
256304
browser_mod:
257305
service: "browser_mod.popup"
258306
data:
259-
large: true
260307
hide_header: true
261308
style: |
262309
--popup-background-color: var(--primary-background-color);
263-
--popup-border-radius: 0px;
310+
--popup-border-radius: 20px;
264311
--popup-padding-x: 24px;
265312
--popup-padding-y: 20px;
313+
--popup-max-width: auto
314+
--popup-min-width: 800px;
315+
card_mod:
316+
style:
317+
ha-dialog$: |
318+
@media (max-width: 800px){
319+
div.mdc-dialog__container {
320+
--mdc-dialog-min-width: 100vw;
321+
--mdc-dialog-max-width: 100vw;
322+
--mdc-dialog-min-height: 100%;
323+
--ha-dialog-border-radius: 0px;
324+
}
325+
}
266326
content:
267327
type: "custom:button-card"
268328
template: >

custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml

+75-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ ulm_actions_icon:
1818
if (action == 'adaptive'){
1919
action = 'call-service'
2020
}
21-
21+
if (domain == "media_player" && action == 'toggle'){
22+
action = 'call-service';
23+
}
2224
if (action == 'popup' && (variables.ulm_custom_popup != null )){
2325
let popup_config = variables.ulm_custom_popup;
2426
if ((typeof popup_config === 'object') && 'template' in popup_config) {
@@ -41,7 +43,9 @@ ulm_actions_icon:
4143
if (action == 'adaptive'){
4244
return 'input_select.select_option';
4345
}
44-
46+
if(entity.entity_id.startsWith("media_player.")){
47+
return 'media_player.media_play_pause';
48+
}
4549
return variables.ulm_icon_tap_service;
4650
]]]
4751
service_data: >
@@ -54,19 +58,35 @@ ulm_actions_icon:
5458
'entity_id': variables.ulm_input_select
5559
};
5660
}
57-
61+
if(entity.entity_id.startsWith("media_player.")){
62+
return {
63+
'entity_id': entity.entity_id
64+
};
65+
}
5866
return variables.ulm_icon_tap_service_data;
5967
]]]
6068
browser_mod:
6169
service: "browser_mod.popup"
6270
data:
63-
large: true
6471
hide_header: true
6572
style: |
6673
--popup-background-color: var(--primary-background-color);
67-
--popup-border-radius: 0px;
74+
--popup-border-radius: 20px;
6875
--popup-padding-x: 24px;
6976
--popup-padding-y: 20px;
77+
--popup-max-width: auto
78+
--popup-min-width: 800px;
79+
card_mod:
80+
style:
81+
ha-dialog$: |
82+
@media (max-width: 800px){
83+
div.mdc-dialog__container {
84+
--mdc-dialog-min-width: 100vw;
85+
--mdc-dialog-max-width: 100vw;
86+
--mdc-dialog-min-height: 100%;
87+
--ha-dialog-border-radius: 0px;
88+
}
89+
}
7090
content:
7191
type: "custom:button-card"
7292
template: >
@@ -115,7 +135,9 @@ ulm_actions_icon:
115135
if (action == 'adaptive'){
116136
action = 'call-service'
117137
}
118-
138+
if (domain == "media_player" && action == 'toggle'){
139+
action = 'call-service';
140+
}
119141
if (action == 'popup' && (variables.ulm_custom_popup != null )){
120142
let popup_config = variables.ulm_custom_popup;
121143
if ((typeof popup_config === 'object') && 'template' in popup_config) {
@@ -138,7 +160,9 @@ ulm_actions_icon:
138160
if (action == 'adaptive'){
139161
return 'input_select.select_option';
140162
}
141-
163+
if(entity.entity_id.startsWith("media_player.")){
164+
return 'media_player.media_play_pause';
165+
}
142166
return variables.ulm_icon_hold_service;
143167
]]]
144168
service_data: >
@@ -151,19 +175,35 @@ ulm_actions_icon:
151175
'entity_id': variables.ulm_input_select
152176
};
153177
}
154-
178+
if(entity.entity_id.startsWith("media_player.")){
179+
return {
180+
'entity_id': entity.entity_id
181+
};
182+
}
155183
return variables.ulm_icon_hold_service_data;
156184
]]]
157185
browser_mod:
158186
service: "browser_mod.popup"
159187
data:
160-
large: true
161188
hide_header: true
162189
style: |
163190
--popup-background-color: var(--primary-background-color);
164-
--popup-border-radius: 0px;
191+
--popup-border-radius: 20px;
165192
--popup-padding-x: 24px;
166193
--popup-padding-y: 20px;
194+
--popup-max-width: auto
195+
--popup-min-width: 800px;
196+
card_mod:
197+
style:
198+
ha-dialog$: |
199+
@media (max-width: 800px){
200+
div.mdc-dialog__container {
201+
--mdc-dialog-min-width: 100vw;
202+
--mdc-dialog-max-width: 100vw;
203+
--mdc-dialog-min-height: 100%;
204+
--ha-dialog-border-radius: 0px;
205+
}
206+
}
167207
content:
168208
type: "custom:button-card"
169209
template: >
@@ -213,7 +253,9 @@ ulm_actions_icon:
213253
if (action == 'adaptive'){
214254
action = 'call-service'
215255
}
216-
256+
if (domain == "media_player" && action == 'toggle'){
257+
action = 'call-service';
258+
}
217259
if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){
218260
action = 'fire-dom-event'
219261
}
@@ -240,7 +282,9 @@ ulm_actions_icon:
240282
if (action == 'adaptive'){
241283
return 'input_select.select_option';
242284
}
243-
285+
if(entity.entity_id.startsWith("media_player.")){
286+
return 'media_player.media_play_pause';
287+
}
244288
return variables.ulm_icon_double_tap_service;
245289
]]]
246290
service_data: >
@@ -253,19 +297,35 @@ ulm_actions_icon:
253297
'entity_id': variables.ulm_input_select
254298
};
255299
}
256-
300+
if(entity.entity_id.startsWith("media_player.")){
301+
return {
302+
'entity_id': entity.entity_id
303+
};
304+
}
257305
return variables.ulm_icon_double_tap_service_data;
258306
]]]
259307
browser_mod:
260308
service: "browser_mod.popup"
261309
data:
262-
large: true
263310
hide_header: true
264311
style: |
265312
--popup-background-color: var(--primary-background-color);
266-
--popup-border-radius: 0px;
313+
--popup-border-radius: 20px;
267314
--popup-padding-x: 24px;
268315
--popup-padding-y: 20px;
316+
--popup-max-width: auto
317+
--popup-min-width: 800px;
318+
card_mod:
319+
style:
320+
ha-dialog$: |
321+
@media (max-width: 800px){
322+
div.mdc-dialog__container {
323+
--mdc-dialog-min-width: 100vw;
324+
--mdc-dialog-max-width: 100vw;
325+
--mdc-dialog-min-height: 100%;
326+
--ha-dialog-border-radius: 0px;
327+
}
328+
}
269329
content:
270330
type: "custom:button-card"
271331
template: >

0 commit comments

Comments
 (0)