Skip to content

Commit

Permalink
fix preset mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fineemb committed Feb 13, 2020
1 parent 769944f commit d67ab68
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions dist/thermostat_card.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,17 @@ export default class ThermostatUI {

_updateColor(state, preset_mode) {

if(preset_mode === undefined)
return;
if(state != 'off' && preset_mode.toLowerCase() == 'idle')
if(Object.prototype.toString.call(preset_mode) === "[object String]"){

if(state != 'off' && preset_mode.toLowerCase() == 'idle')
state = 'idle'

this._root.classList.forEach(c => {
if (c.indexOf('dial--state--') != -1)
this._root.classList.remove(c);
});
this._root.classList.add('dial--state--' + state);
this._root.classList.forEach(c => {
if (c.indexOf('dial--state--') != -1)
this._root.classList.remove(c);
});
this._root.classList.add('dial--state--' + state);
}
}

_updateTicks(from, to, large_ticks, hvac_state) {
Expand Down

0 comments on commit d67ab68

Please sign in to comment.