Bugfix for switches that support standby

This commit is contained in:
Paulus Schoutsen 2015-08-31 08:24:01 -07:00
parent 10b322a4fa
commit b0b12e20e0

View File

@ -28,7 +28,7 @@ export default new Polymer({
if (newVal && this.stateObj.state === 'off') { if (newVal && this.stateObj.state === 'off') {
this.turn_on(); this.turn_on();
} else if (!newVal && this.stateObj.state === 'on') { } else if (!newVal && this.stateObj.state !== 'off') {
this.turn_off(); this.turn_off();
} }
}, },
@ -40,7 +40,7 @@ export default new Polymer({
}, },
updateToggle(stateObj) { updateToggle(stateObj) {
this.toggleChecked = stateObj && stateObj.state === 'on'; this.toggleChecked = stateObj && stateObj.state !== 'off';
}, },
forceStateChange() { forceStateChange() {