Skip to content

Commit

Permalink
Update fan-percent-button-row.js
Browse files Browse the repository at this point in the history
  • Loading branch information
finity69x2 authored Aug 6, 2021
1 parent d8948fc commit b7ba1f1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dist/fan-percent-button-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class CustomFanPercentRow extends Polymer.Element {
customSetpoints: false,
reverseButtons: false,
isTwoSpeedFan: false,
sendStateWithSpeed: false,
offPercentage: 0,
lowPercentage: 33,
medPercentage: 66,
Expand Down Expand Up @@ -132,6 +133,7 @@ class CustomFanPercentRow extends Polymer.Element {
const custSetpoint = config.customSetpoints;
const revButtons = config.reverseButtons;
const twoSpdFan = config.isTwoSpeedFan;
const sendStateWithSpeed = config.sendStateWithSpeed;
const buttonWidth = config.width;
const buttonHeight = config.height;
const OnLowClr = config.isOnLowColor;
Expand Down Expand Up @@ -342,12 +344,21 @@ class CustomFanPercentRow extends Polymer.Element {
param.percentage = this._offSP;
this.hass.callService('fan', 'set_percentage', param);
} else if (level == 'low') {
if(this._config.sendStateWithSpeed){
this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
}
param.percentage = this._lowSP;
this.hass.callService('fan', 'set_percentage', param);
} else if (level == 'medium') {
if(this._config.sendStateWithSpeed){
this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
}
param.percentage = this._medSP;
this.hass.callService('fan', 'set_percentage', param);
} else if (level == 'high') {
if(this._config.sendStateWithSpeed){
this.hass.callService('fan', 'turn_on', {entity_id: this._config.entity});
}
param.percentage = this._highSP;
this.hass.callService('fan', 'set_percentage', param);
}
Expand Down

0 comments on commit b7ba1f1

Please sign in to comment.