Skip to content

Commit 6005387

Browse files
authored
Hotfix undefined variable if not called by browser_mod
1 parent 0fbd171 commit 6005387

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml

+15-15
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ popup_thermostat_temperature:
6464
card:
6565
type: "custom:button-card"
6666
variables:
67-
ulm_card_thermostat_preset_mode: "[[[ return variables.ulm_card_thermostat_preset_mode; ]]]"
67+
ulm_card_thermostat_preset_mode: "[[[ return variables?.ulm_card_thermostat_preset_mode; ]]]"
6868
styles:
6969
grid:
7070
- grid-template-areas: >
7171
[[[
7272
var areas = [];
73-
if (variables.ulm_card_thermostat_preset_mode){
73+
if (variables?.ulm_card_thermostat_preset_mode){
7474
if (entity.attributes.preset_modes.includes("none")) {
7575
areas.push("none");
7676
}
@@ -114,7 +114,7 @@ popup_thermostat_temperature:
114114
- grid-template-columns: >
115115
[[[
116116
var columns = [];
117-
if (variables.ulm_card_thermostat_preset_mode){
117+
if (variables?.ulm_card_thermostat_preset_mode){
118118
if (entity.attributes.preset_modes.includes("none")) {
119119
columns.push("1fr");
120120
}
@@ -166,7 +166,7 @@ popup_thermostat_temperature:
166166
auto:
167167
- display: >
168168
[[[
169-
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("auto")) {
169+
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("auto")) {
170170
return "block";
171171
} else {
172172
return "none";
@@ -175,7 +175,7 @@ popup_thermostat_temperature:
175175
heat:
176176
- display: >
177177
[[[
178-
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat")) {
178+
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat")) {
179179
return "block";
180180
} else {
181181
return "none";
@@ -184,7 +184,7 @@ popup_thermostat_temperature:
184184
cool:
185185
- display: >
186186
[[[
187-
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("cool") ) {
187+
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("cool") ) {
188188
return "block";
189189
} else {
190190
return "none";
@@ -193,7 +193,7 @@ popup_thermostat_temperature:
193193
dry:
194194
- display: >
195195
[[[
196-
if ( !variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("dry")) {
196+
if ( !variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("dry")) {
197197
return "block";
198198
} else {
199199
return "none";
@@ -202,7 +202,7 @@ popup_thermostat_temperature:
202202
fan_only:
203203
- display: >
204204
[[[
205-
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("fan_only")) {
205+
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("fan_only")) {
206206
return "block";
207207
} else {
208208
return "none";
@@ -211,7 +211,7 @@ popup_thermostat_temperature:
211211
heat_cool:
212212
- display: >
213213
[[[
214-
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat_cool")) {
214+
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat_cool")) {
215215
return "block";
216216
} else {
217217
return "none";
@@ -220,7 +220,7 @@ popup_thermostat_temperature:
220220
none:
221221
- display: >
222222
[[[
223-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("none")) {
223+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("none")) {
224224
return "block";
225225
} else {
226226
return "none";
@@ -229,7 +229,7 @@ popup_thermostat_temperature:
229229
away:
230230
- display: >
231231
[[[
232-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("away")) {
232+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("away")) {
233233
return "block";
234234
} else {
235235
return "none";
@@ -238,7 +238,7 @@ popup_thermostat_temperature:
238238
comfort:
239239
- display: >
240240
[[[
241-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("comfort")) {
241+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("comfort")) {
242242
return "block";
243243
} else {
244244
return "none";
@@ -247,7 +247,7 @@ popup_thermostat_temperature:
247247
home:
248248
- display: >
249249
[[[
250-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("home")) {
250+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("home")) {
251251
return "block";
252252
} else {
253253
return "none";
@@ -256,7 +256,7 @@ popup_thermostat_temperature:
256256
sleep:
257257
- display: >
258258
[[[
259-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("sleep")) {
259+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("sleep")) {
260260
return "block";
261261
} else {
262262
return "none";
@@ -265,7 +265,7 @@ popup_thermostat_temperature:
265265
activity:
266266
- display: >
267267
[[[
268-
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("activity")) {
268+
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("activity")) {
269269
return "block";
270270
} else {
271271
return "none";

0 commit comments

Comments
 (0)