Skip to content

Commit d95b2f7

Browse files
authored
Update fan-control-entity-row.js
1 parent 4003d37 commit d95b2f7

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

dist/fan-control-entity-row.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CustomFanRow extends Polymer.Element {
3333
<div class='horizontal justified layout' on-click="stopPropagation">
3434
<button
3535
class='speed'
36-
style='[[_leftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
36+
style='[[_leftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]];[[_hideLeft]]'
3737
toggles name="[[_leftName]]"
3838
on-click='setSpeed'
3939
disabled='[[_leftState]]'>[[_leftText]]</button>
@@ -51,7 +51,7 @@ class CustomFanRow extends Polymer.Element {
5151
disabled='[[_midRightState]]'>[[_midRightText]]</button>
5252
<button
5353
class='speed'
54-
style='[[_rightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
54+
style='[[_rightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]];[[_hideRight]]'
5555
toggles name="[[_rightName]]"
5656
on-click='setSpeed'
5757
disabled='[[_rightState]]'>[[_rightText]]</button>
@@ -82,8 +82,10 @@ class CustomFanRow extends Polymer.Element {
8282
_midLeftName: String,
8383
_midRightName: String,
8484
_rightName: String,
85+
_hideLeft: String,
8586
_hideMidLeft: String,
8687
_hideMidRight: String,
88+
_hideRight: String,
8789
_leftState: Boolean,
8890
_midLeftState: Boolean,
8991
_midRightState: Boolean,
@@ -100,6 +102,7 @@ class CustomFanRow extends Polymer.Element {
100102
sendStateWithSpeed: false,
101103
reverseButtons: false,
102104
isTwoSpeedFan: false,
105+
hideOff: false,
103106
width: '30px',
104107
height: '30px',
105108
isOffColor: '#f44c09',
@@ -123,6 +126,7 @@ class CustomFanRow extends Polymer.Element {
123126
const sendStateWithSpeed = config.sendStateWithSpeed;
124127
const revButtons = config.reverseButtons;
125128
const twoSpdFan = config.isTwoSpeedFan;
129+
const hide_Off = config.hideOff;
126130
const buttonWidth = config.width;
127131
const buttonHeight = config.height;
128132
const custOnLowClr = config.isOnLowColor;
@@ -227,6 +231,7 @@ class CustomFanRow extends Polymer.Element {
227231
let lowname = 'low';
228232
let offname = 'off';
229233

234+
let hideoff = 'display:block';
230235
let hidemedium = 'display:block';
231236
let nohide = 'display:block';
232237

@@ -236,6 +241,11 @@ class CustomFanRow extends Polymer.Element {
236241
hidemedium = 'display:block';
237242
}
238243

244+
if (hide_Off) {
245+
hideoff = 'display:none';
246+
} else {
247+
hideoff = 'display:block';
248+
}
239249

240250
if (revButtons) {
241251
this.setProperties({
@@ -258,8 +268,10 @@ class CustomFanRow extends Polymer.Element {
258268
_midLeftName: lowname,
259269
_midRightName: medname,
260270
_rightName: hiname,
271+
_hideLeft: hideoff,
261272
_hideMidLeft: nohide,
262273
_hideMidRight: hidemedium,
274+
_hideRight: nohide,
263275
});
264276
} else {
265277
this.setProperties({
@@ -282,8 +294,10 @@ class CustomFanRow extends Polymer.Element {
282294
_midLeftName: medname,
283295
_midRightName: lowname,
284296
_rightName: offname,
297+
_hideRight: hideoff,
285298
_hideMidRight: nohide,
286299
_hideMidLeft: hidemedium,
300+
_hideLeft: nohide,
287301
});
288302
}
289303
}

0 commit comments

Comments
 (0)