@@ -63,29 +63,29 @@ class CustomFanRow extends Polymer.Element {
6363 } ,
6464 _config : Object ,
6565 _stateObj : Object ,
66- _lowOnColor : String ,
67- _medOnColor : String ,
68- _highOnColor : String ,
69- _offColor : String ,
70- _isOffState : Boolean ,
66+ _lowOnColor : String ,
67+ _medOnColor : String ,
68+ _highOnColor : String ,
69+ _offColor : String ,
70+ _isOffState : Boolean ,
7171 _isOnState : Boolean ,
7272 _isOnLow : Boolean ,
73- _isOnMed : Boolean ,
73+ _isOnMed : Boolean ,
7474 _isOnHigh : Boolean ,
75- }
75+ }
7676 }
7777
7878 setConfig ( config ) {
7979 this . _config = config ;
8080
8181 this . _config = {
8282 customTheme : false ,
83- sendStateWithSpeed : false ,
84- customIsOffColor : '#f44c09' ,
85- customIsOnLowColor : '#43A047' ,
86- customIsOnMedColor : '#43A047' ,
87- customIsOnHiColor : '#43A047' ,
88- customIsOffSpdColor : '#759aaa' ,
83+ sendStateWithSpeed : false ,
84+ customIsOffColor : '#f44c09' ,
85+ customIsOnLowColor : '#43A047' ,
86+ customIsOnMedColor : '#43A047' ,
87+ customIsOnHiColor : '#43A047' ,
88+ customIsOffSpdColor : '#759aaa' ,
8989 ...config
9090 } ;
9191 }
@@ -94,13 +94,13 @@ class CustomFanRow extends Polymer.Element {
9494
9595 const config = this . _config ;
9696 const stateObj = hass . states [ config . entity ] ;
97- const custTheme = config . customTheme ;
98- const sendStateWithSpeed = config . sendStateWithSpeed ;
99- const custOnLowClr = config . customIsOnLowColor ;
100- const custOnMedClr = config . customIsOnMedColor ;
101- const custOnHiClr = config . customIsOnHiColor ;
102- const custOffSpdClr = config . customIsOffSpdColor ;
103- const custOffClr = config . customIsOffColor ;
97+ const custTheme = config . customTheme ;
98+ const sendStateWithSpeed = config . sendStateWithSpeed ;
99+ const custOnLowClr = config . customIsOnLowColor ;
100+ const custOnMedClr = config . customIsOnMedColor ;
101+ const custOnHiClr = config . customIsOnHiColor ;
102+ const custOffSpdClr = config . customIsOffSpdColor ;
103+ const custOffClr = config . customIsOffColor ;
104104
105105
106106
@@ -126,7 +126,7 @@ class CustomFanRow extends Polymer.Element {
126126 }
127127 }
128128
129- let lowcolor ;
129+ let lowcolor ;
130130 let medcolor ;
131131 let hicolor ;
132132 let offcolor ;
@@ -160,35 +160,35 @@ class CustomFanRow extends Polymer.Element {
160160 } else {
161161
162162 if ( low == 'on' ) {
163- lowcolor = 'background-color: var(--switch-checked -color)' ;
163+ lowcolor = 'background-color: var(--primary -color)' ;
164164 } else {
165- lowcolor = 'background-color: var(--switch-unchecked -color)' ;
165+ lowcolor = 'background-color: var(--disabled-text -color)' ;
166166 }
167167
168168 if ( med == 'on' ) {
169- medcolor = 'background-color: var(--switch-checked -color)' ;
169+ medcolor = 'background-color: var(--primary -color)' ;
170170 } else {
171- medcolor = 'background-color: var(--switch-unchecked -color)' ;
171+ medcolor = 'background-color: var(--disabled-text -color)' ;
172172 }
173173
174174 if ( high == 'on' ) {
175- hicolor = 'background-color: var(--switch-checked -color)' ;
175+ hicolor = 'background-color: var(--primary -color)' ;
176176 } else {
177- hicolor = 'background-color: var(--switch-unchecked -color)' ;
177+ hicolor = 'background-color: var(--disabled-text -color)' ;
178178 }
179179
180180 if ( offstate == 'on' ) {
181- offcolor = 'background-color: var(--switch-checked -color)' ;
181+ offcolor = 'background-color: var(--primary -color)' ;
182182 } else {
183- offcolor = 'background-color: var(--switch-unchecked -color)' ;
183+ offcolor = 'background-color: var(--disabled-text -color)' ;
184184 }
185185 }
186186
187187
188188 this . setProperties ( {
189- _stateObj : stateObj ,
189+ _stateObj : stateObj ,
190190 _isOffState : stateObj . state == 'off' ,
191- _isOnLow : low === 'on' ,
191+ _isOnLow : low === 'on' ,
192192 _isOnMed : med === 'on' ,
193193 _isOnHigh : high === 'on' ,
194194 _lowOnColor : lowcolor ,
@@ -202,7 +202,7 @@ 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' ) {
208208 this . hass . callService ( 'fan' , 'turn_off' , { entity_id : this . _config . entity } ) ;
@@ -215,7 +215,6 @@ class CustomFanRow extends Polymer.Element {
215215 }
216216
217217}
218-
219- }
220218
221219customElements . define ( 'fan-control-entity-row' , CustomFanRow ) ;
220+
0 commit comments