Skip to content

Commit 13b67ed

Browse files
authored
Update fan-control-entity-row.js
1 parent 0c6241e commit 13b67ed

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

dist/fan-control-entity-row.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ class CustomFanRow extends Polymer.Element {
88
line-height: inherit;
99
}
1010
.speed {
11-
min-width: 30px;
12-
max-width: 30px;
13-
height: 30px;
1411
margin-left: 2px;
1512
margin-right: 2px;
1613
background-color: #759aaa;
@@ -28,25 +25,25 @@ class CustomFanRow extends Polymer.Element {
2825
<div class='horizontal justified layout' on-click="stopPropagation">
2926
<button
3027
class='speed'
31-
style='[[_leftColor]]'
28+
style='[[_leftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
3229
toggles name="[[_leftName]]"
3330
on-click='setSpeed'
3431
disabled='[[_leftState]]'>[[_leftText]]</button>
3532
<button
3633
class='speed'
37-
style='[[_midLeftColor]];[[_hideMidLeft]]'
34+
style='[[_midLeftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]];[[_hideMidLeft]]'
3835
toggles name="[[_midLeftName]]"
3936
on-click='setSpeed'
4037
disabled='[[_midLeftState]]'>[[_midLeftText]]</button>
4138
<button
4239
class='speed'
43-
style='[[_midRightColor]];[[_hideMidRight]]'
40+
style='[[_midRightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]];[[_hideMidRight]]'
4441
toggles name="[[_midRightName]]"
4542
on-click='setSpeed'
4643
disabled='[[_midRightState]]'>[[_midRightText]]</button>
4744
<button
4845
class='speed'
49-
style='[[_rightColor]]'
46+
style='[[_rightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
5047
toggles name="[[_rightName]]"
5148
on-click='setSpeed'
5249
disabled='[[_rightState]]'>[[_rightText]]</button>
@@ -63,6 +60,8 @@ class CustomFanRow extends Polymer.Element {
6360
},
6461
_config: Object,
6562
_stateObj: Object,
63+
_width: String,
64+
_height: String,
6665
_leftColor: String,
6766
_midLeftColor: String,
6867
_midRightColor: String,
@@ -93,6 +92,8 @@ class CustomFanRow extends Polymer.Element {
9392
sendStateWithSpeed: false,
9493
reverseButtons: false,
9594
isTwoSpeedFan: false,
95+
width: '30px',
96+
height: '30px',
9697
isOffColor: '#f44c09',
9798
isOnLowColor: '#43A047',
9899
isOnMedColor: '#43A047',
@@ -114,6 +115,8 @@ class CustomFanRow extends Polymer.Element {
114115
const sendStateWithSpeed = config.sendStateWithSpeed;
115116
const revButtons = config.reverseButtons;
116117
const twoSpdFan = config.isTwoSpeedFan;
118+
const buttonWidth = config.width;
119+
const buttonHeight = config.height;
117120
const custOnLowClr = config.isOnLowColor;
118121
const custOnMedClr = config.isOnMedColor;
119122
const custOnHiClr = config.isOnHiColor;
@@ -208,6 +211,9 @@ class CustomFanRow extends Polymer.Element {
208211
let medtext = custMedTxt;
209212
let hitext = custHiTxt;
210213

214+
let buttonwidth = buttonWidth;
215+
let buttonheight = buttonHeight;
216+
211217
let hiname = 'high';
212218
let medname = 'medium';
213219
let lowname = 'low';
@@ -230,6 +236,8 @@ class CustomFanRow extends Polymer.Element {
230236
_midLeftState: low == 'on',
231237
_midRightState: med == 'on',
232238
_rightState: high == 'on',
239+
_width: buttonwidth,
240+
_height: buttonheight,
233241
_leftColor: offcolor,
234242
_midLeftColor: lowcolor,
235243
_midRightColor: medcolor,
@@ -252,6 +260,8 @@ class CustomFanRow extends Polymer.Element {
252260
_midLeftState: med == 'on',
253261
_midRightState: low == 'on',
254262
_rightState: offstate == 'on',
263+
_width: buttonwidth,
264+
_height: buttonheight,
255265
_leftColor: hicolor,
256266
_midLeftColor: medcolor,
257267
_midRightColor: lowcolor,

0 commit comments

Comments
 (0)