@@ -16,10 +16,10 @@ ulm_actions_card:
16
16
action = 'popup'
17
17
}
18
18
if (action == 'adaptive'){
19
- action = 'call-service '
19
+ action = 'perform-action '
20
20
}
21
21
if (domain == "media_player" && action == 'toggle'){
22
- action = 'call-service ';
22
+ action = 'perform-action ';
23
23
}
24
24
if (action == 'popup' && (variables.ulm_custom_popup != null )){
25
25
let popup_config = variables.ulm_custom_popup;
@@ -36,34 +36,34 @@ ulm_actions_card:
36
36
]]]
37
37
navigation_path : " [[[ return variables.ulm_card_tap_action == 'navigate' ? variables.ulm_card_tap_navigate_path : '/0' ]]]"
38
38
haptic : " [[[ return variables.ulm_card_tap_haptic != null ? variables.ulm_card_tap_haptic : 'none' ]]]"
39
- service : >
39
+ perform_action : >
40
40
[[[
41
- var action = variables.ulm_card_tap_action;
42
-
43
- if (action == 'adaptive'){
41
+ if (variables.ulm_card_tap_action == 'adaptive')
44
42
return 'input_select.select_option';
45
- }
46
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
43
+ else if (variables.ulm_card_tap_service !== undefined)
44
+ return variables.ulm_card_tap_service;
45
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
47
46
return 'media_player.media_play_pause';
48
- }
49
- return variables.ulm_card_tap_service;
47
+ return "";
50
48
]]]
51
- service_data : >
49
+ target :
50
+ entity_id : >
51
+ [[[
52
+ if (variables.ulm_card_tap_action == 'adaptive')
53
+ return variables.ulm_input_select;
54
+ else if (variables.ulm_card_tap_target !== undefined)
55
+ return variables.ulm_card_tap_target;
56
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
57
+ return entity.entity_id;
58
+ return "";
59
+ ]]]
60
+ data : >
52
61
[[[
53
- var action = variables.ulm_card_tap_action;
54
-
55
- if (action == 'adaptive'){
56
- return {
57
- 'option': variables.ulm_input_select_option,
58
- 'entity_id': variables.ulm_input_select
59
- };
60
- }
61
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
62
- return {
63
- 'entity_id': entity.entity_id
64
- };
65
- }
66
- return variables.ulm_card_tap_service_data;
62
+ if (variables.ulm_card_tap_action == 'adaptive'){
63
+ return {'option': variables.ulm_input_select_option };
64
+ else if (variables.ulm_card_tap_service_data !== undefined)
65
+ return variables.ulm_card_tap_service_data;
66
+ return "";
67
67
]]]
68
68
browser_mod :
69
69
service : " browser_mod.popup"
@@ -129,10 +129,10 @@ ulm_actions_card:
129
129
action = 'popup'
130
130
}
131
131
if (action == 'adaptive'){
132
- action = 'call-service '
132
+ action = 'perform-action '
133
133
}
134
134
if (domain == "media_player" && action == 'toggle'){
135
- action = 'call-service ';
135
+ action = 'perform-action ';
136
136
}
137
137
if (action == 'popup' && (variables.ulm_custom_popup != null )){
138
138
let popup_config = variables.ulm_custom_popup;
@@ -149,34 +149,34 @@ ulm_actions_card:
149
149
]]]
150
150
navigation_path : " [[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]"
151
151
haptic : " [[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]"
152
- service : >
152
+ perform_action : >
153
153
[[[
154
- var action = variables.ulm_card_hold_action;
155
-
156
- if (action == 'adaptive'){
154
+ if (variables.ulm_card_hold_action == 'adaptive')
157
155
return 'input_select.select_option';
158
- }
159
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
156
+ else if (variables.ulm_card_hold_service !== undefined)
157
+ return variables.ulm_card_hold_service;
158
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
160
159
return 'media_player.media_play_pause';
161
- }
162
- return variables.ulm_card_hold_service;
160
+ return "";
163
161
]]]
164
- service_data : >
162
+ target :
163
+ entity_id : >
164
+ [[[
165
+ if (variables.ulm_card_hold_action == 'adaptive')
166
+ return variables.ulm_input_select;
167
+ else if (variables.ulm_card_hold_target !== undefined)
168
+ return variables.ulm_card_hold_target;
169
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
170
+ return entity.entity_id;
171
+ return "";
172
+ ]]]
173
+ data : >
165
174
[[[
166
- var action = variables.ulm_card_hold_action;
167
-
168
- if (action == 'adaptive'){
169
- return {
170
- 'option': variables.ulm_input_select_option,
171
- 'entity_id': variables.ulm_input_select
172
- };
173
- }
174
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
175
- return {
176
- 'entity_id': entity.entity_id
177
- };
178
- }
179
- return variables.ulm_card_hold_service_data;
175
+ if (variables.ulm_card_hold_action == 'adaptive')
176
+ return { 'option': variables.ulm_input_select_option };
177
+ else if (variables.ulm_card_hold_service_data !== undefined)
178
+ return variables.ulm_card_hold_service_data;
179
+ return "";
180
180
]]]
181
181
browser_mod :
182
182
service : " browser_mod.popup"
@@ -242,10 +242,10 @@ ulm_actions_card:
242
242
action = 'popup'
243
243
}
244
244
if (action == 'adaptive'){
245
- action = 'call-service '
245
+ action = 'perform-action '
246
246
}
247
247
if (domain == "media_player" && action == 'toggle'){
248
- action = 'call-service ';
248
+ action = 'perform-action ';
249
249
}
250
250
if (action == 'popup' && (variables.ulm_custom_popup != null )){
251
251
let popup_config = variables.ulm_custom_popup;
@@ -262,34 +262,34 @@ ulm_actions_card:
262
262
]]]
263
263
navigation_path : " [[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]"
264
264
haptic : " [[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]"
265
- service : >
265
+ perform_action : >
266
266
[[[
267
- var action = variables.ulm_card_double_tap_action;
268
-
269
- if (action == 'adaptive'){
267
+ if (variables.ulm_card_double_tap_action == 'adaptive')
270
268
return 'input_select.select_option';
271
- }
272
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
269
+ else if (variables.ulm_card_double_tap_service !== undefined)
270
+ return variables.ulm_card_double_tap_service;
271
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
273
272
return 'media_player.media_play_pause';
274
- }
275
- return variables.ulm_card_double_tap_service;
273
+ return "";
276
274
]]]
277
- service_data : >
275
+ target :
276
+ entity_id : >
277
+ [[[
278
+ if (variables.ulm_card_double_tap_action == 'adaptive')
279
+ return variables.ulm_input_select;
280
+ else if (variables.ulm_card_double_tap_target !== undefined)
281
+ return variables.ulm_card_double_tap_target;
282
+ else if ((entity != null) && entity.entity_id.startsWith("media_player."))
283
+ return entity.entity_id;
284
+ return "";
285
+ ]]]
286
+ data : >
278
287
[[[
279
- var action = variables.ulm_card_double_tap_action;
280
-
281
- if (action == 'adaptive'){
282
- return {
283
- 'option': variables.ulm_input_select_option,
284
- 'entity_id': variables.ulm_input_select
285
- };
286
- }
287
- if((entity != null) && entity.entity_id.startsWith("media_player.")){
288
- return {
289
- 'entity_id': entity.entity_id
290
- };
291
- }
292
- return variables.ulm_card_double_tap_service_data;
288
+ if (variables.ulm_card_double_tap_action == 'adaptive')
289
+ return { 'option': variables.ulm_input_select_option };
290
+ else if (variables.ulm_card_double_tap_service_data !== undefined)
291
+ return variables.ulm_card_double_tap_service_data;
292
+ return "";
293
293
]]]
294
294
browser_mod :
295
295
service : " browser_mod.popup"
0 commit comments