Skip to content

Commit

Permalink
Merge pull request #1178 from basbruss/bugs
Browse files Browse the repository at this point in the history
Fix: Multiple Bugs
  • Loading branch information
basbruss authored Feb 17, 2023
2 parents faf06b0 + cfef13a commit a49b298
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ card_scenes_welcome:
- grid-template-areas: >
[[[
var pills = []
const entities = [variables.entity_1.entity_id, variables.entity_2.entity_id, variables.entity_3.entity_id, variables.entity_4.entity_id, variables.entity_5.entity_id, variables.entity_6.entity_id, variables.entity_7.entity_id]
const entities = [variables.entity_1?.entity_id, variables.entity_2?.entity_id, variables.entity_3?.entity_id, variables.entity_4?.entity_id, variables.entity_5?.entity_id, variables.entity_6?.entity_id, variables.entity_7?.entity_id]
function entity_check(item) {
if (item != "") {
pills.push("item" + (pills.length+1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ card_scenes_pill_welcome:
- operator: "template"
value: >
[[[
return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state)
return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state)
]]]
styles:
card:
Expand Down Expand Up @@ -341,7 +341,7 @@ card_scenes_pill_welcome:
- operator: "template"
value: >
[[[
return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state)
return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state)
]]]
styles:
card:
Expand Down Expand Up @@ -400,13 +400,13 @@ card_scenes_pill_welcome:
- font-weight: "bold"
- font-size: "9.5px"
- padding-bottom: "7px"
- overflow: "[[[return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state) ? 'visible' : 'hidden']]]"
- overflow: "[[[return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state) ? 'visible' : 'hidden']]]"
card:
- box-shadow: "none"
- padding: "0px 5px 5px 5px"
- margin-top: "-5px"
- border-radius: "50px"
- overflow: "[[[return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state) ? 'visible' : 'hidden']]]"
- overflow: "[[[return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state) ? 'visible' : 'hidden']]]"
card_topbar_welcome:
show_icon: false
show_name: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,42 +70,42 @@ popup_thermostat_temperature:
- grid-template-areas: >
[[[
var areas = [];
if (variables.ulm_card_thermostat_preset_mode){
if (entity.attributes.preset_modes.toString().toLowerCase().includes("none")) {
if (variables?.ulm_card_thermostat_preset_mode){
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("none")) {
areas.push("none");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("away")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("away")) {
areas.push("away");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("comfort")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("comfort")) {
areas.push("comfort");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("home")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("home")) {
areas.push("home");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("sleep")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("sleep")) {
areas.push("sleep");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("activity")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("activity")) {
areas.push("activity");
}
} else {
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("auto")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("auto")) {
areas.push("auto");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("heat")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("heat")) {
areas.push("heat");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("cool")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("cool")) {
areas.push("cool");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("dry")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("dry")) {
areas.push("dry");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("fan_only")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("fan_only")) {
areas.push("fan_only");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("heat_cool")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("heat_cool")) {
areas.push("heat_cool");
}
}
Expand All @@ -114,42 +114,42 @@ popup_thermostat_temperature:
- grid-template-columns: >
[[[
var columns = [];
if (variables.ulm_card_thermostat_preset_mode){
if (entity.attributes.preset_modes.toString().toLowerCase().includes("none")) {
if (variables?.ulm_card_thermostat_preset_mode){
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("none")) {
columns.push("1fr");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("away")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("away")) {
columns.push("1fr");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("comfort")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("comfort")) {
columns.push("1fr");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("home")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("home")) {
columns.push("1fr");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("sleep")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("sleep")) {
columns.push("1fr");
}
if (entity.attributes.preset_modes.toString().toLowerCase().includes("activity")) {
if (entity.attributes?.preset_modes.toString().toLowerCase().includes("activity")) {
columns.push("1fr");
}
} else {
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("auto")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("auto")) {
columns.push("1fr");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("heat")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("heat")) {
columns.push("1fr");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("cool")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("cool")) {
columns.push("1fr");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("dry")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("dry")) {
columns.push("1fr");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("fan_only")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("fan_only")) {
columns.push("1fr");
}
if (entity.attributes.hvac_modes.toString().toLowerCase().includes("heat_cool")) {
if (entity.attributes?.hvac_modes.toString().toLowerCase().includes("heat_cool")) {
columns.push("1fr");
}
}
Expand All @@ -166,7 +166,7 @@ popup_thermostat_temperature:
auto:
- display: >
[[[
if (!variables.ulm_card_thermostat_preset_mode && entity.attributes.hvac_modes.toString().toLowerCase().includes("auto")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("heat")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("cool") ) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("dry")) {
if ( !variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("fan_only")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("heat_cool")) {
if (!variables?.ulm_card_thermostat_preset_mode && entity.attributes?.hvac_modes.toString().toLowerCase().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.toString().toLowerCase().includes("none")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().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.toString().toLowerCase().includes("away")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().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.toString().toLowerCase().includes("comfort")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().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.toString().toLowerCase().includes("home")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().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.toString().toLowerCase().includes("sleep")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().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.toString().toLowerCase().includes("activity")) {
if (variables?.ulm_card_thermostat_preset_mode && entity.attributes?.preset_modes.toString().toLowerCase().includes("activity")) {
return "block";
} else {
return "none";
Expand Down

0 comments on commit a49b298

Please sign in to comment.