Skip to content

Commit 6faf157

Browse files
authored
switch set speed and turn on command
1 parent 36d2494 commit 6faf157

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

dist/fan-control-entity-row.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,20 @@ class CustomFanRow extends Polymer.Element {
202202
e.stopPropagation();
203203
}
204204

205-
setSpeed(e) {
205+
setSpeed(e) {
206206
const speed = e.currentTarget.getAttribute('name');
207207
if( speed == 'off' ){
208-
this.hass.callService('fan', 'turn_off', {entity_id: this._config.entity});
209-
} else {
210-
this.hass.callService('fan', 'set_speed', {entity_id: this._config.entity, speed: speed});
211-
if(this._config.sendStateWithSpeed){
208+
this.hass.callService('fan', 'turn_off', {entity_id: this._config.entity});
209+
} else {
210+
if(this._config.sendStateWithSpeed){
212211
this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
213-
}
214-
}
212+
}
213+
this.hass.callService('fan', 'set_speed', {entity_id: this._config.entity, speed: speed});
214+
}
215215
}
216216

217217
}
218+
219+
}
218220

219221
customElements.define('fan-control-entity-row', CustomFanRow);

0 commit comments

Comments
 (0)