Skip to content

Commit

Permalink
fix thermostat card for thermostats without mode / off state
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfonso committed Dec 9, 2023
1 parent 7338e65 commit 934af06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/converters/climate.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,15 @@ function fillClimateEntityFromStates(states, objects, entity, iobType) {
attr.historyParser = (id, val) => { return translateModeNameForLovelace(attr.states ? (attr.states[val] || val) : val); };
}

//add minimal hvac_modes, if none were found from the states above:
if (!entity.attributes.hvac_modes) {
if (iobType === typeDetector.Types.airCondition) {
entity.attributes.hvac_modes = ['cool'];
} else {
entity.attributes.hvac_modes = ['heat'];
}
}

//defaults:
entity.attributes.min_temp = 7;
entity.attributes.max_temp = 35;
Expand Down

0 comments on commit 934af06

Please sign in to comment.