Skip to content

Commit

Permalink
Hotfix undefined variable if not called by browser_mod
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss authored Sep 28, 2022
1 parent 0fbd171 commit 6005387
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ popup_thermostat_temperature:
card:
type: "custom:button-card"
variables:
ulm_card_thermostat_preset_mode: "[[[ return variables.ulm_card_thermostat_preset_mode; ]]]"
ulm_card_thermostat_preset_mode: "[[[ return variables?.ulm_card_thermostat_preset_mode; ]]]"
styles:
grid:
- grid-template-areas: >
[[[
var areas = [];
if (variables.ulm_card_thermostat_preset_mode){
if (variables?.ulm_card_thermostat_preset_mode){
if (entity.attributes.preset_modes.includes("none")) {
areas.push("none");
}
Expand Down Expand Up @@ -114,7 +114,7 @@ popup_thermostat_temperature:
- grid-template-columns: >
[[[
var columns = [];
if (variables.ulm_card_thermostat_preset_mode){
if (variables?.ulm_card_thermostat_preset_mode){
if (entity.attributes.preset_modes.includes("none")) {
columns.push("1fr");
}
Expand Down Expand Up @@ -166,7 +166,7 @@ popup_thermostat_temperature:
auto:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("auto")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("auto")) {
return "block";
} else {
return "none";
Expand All @@ -175,7 +175,7 @@ popup_thermostat_temperature:
heat:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat")) {
return "block";
} else {
return "none";
Expand All @@ -184,7 +184,7 @@ popup_thermostat_temperature:
cool:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("cool") ) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("cool") ) {
return "block";
} else {
return "none";
Expand All @@ -193,7 +193,7 @@ popup_thermostat_temperature:
dry:
- display: >
[[[
if ( !variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("dry")) {
if ( !variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("dry")) {
return "block";
} else {
return "none";
Expand All @@ -202,7 +202,7 @@ popup_thermostat_temperature:
fan_only:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("fan_only")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("fan_only")) {
return "block";
} else {
return "none";
Expand All @@ -211,7 +211,7 @@ popup_thermostat_temperature:
heat_cool:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat_cool")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.includes("heat_cool")) {
return "block";
} else {
return "none";
Expand All @@ -220,7 +220,7 @@ popup_thermostat_temperature:
none:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("none")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("none")) {
return "block";
} else {
return "none";
Expand All @@ -229,7 +229,7 @@ popup_thermostat_temperature:
away:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("away")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("away")) {
return "block";
} else {
return "none";
Expand All @@ -238,7 +238,7 @@ popup_thermostat_temperature:
comfort:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("comfort")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("comfort")) {
return "block";
} else {
return "none";
Expand All @@ -247,7 +247,7 @@ popup_thermostat_temperature:
home:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("home")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("home")) {
return "block";
} else {
return "none";
Expand All @@ -256,7 +256,7 @@ popup_thermostat_temperature:
sleep:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("sleep")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("sleep")) {
return "block";
} else {
return "none";
Expand All @@ -265,7 +265,7 @@ popup_thermostat_temperature:
activity:
- display: >
[[[
if (variables.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("activity")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes.preset_modes.includes("activity")) {
return "block";
} else {
return "none";
Expand Down

0 comments on commit 6005387

Please sign in to comment.