@@ -5,15 +5,12 @@ import { customElement, property, query, state } from "lit/decorators";
5
5
import { stopPropagation } from "../../../common/dom/stop_propagation" ;
6
6
import { computeDomain } from "../../../common/entity/compute_domain" ;
7
7
import { supportsFeature } from "../../../common/entity/supports-feature" ;
8
+ import "../../../components/ha-attribute-icon" ;
8
9
import "../../../components/ha-control-select" ;
9
10
import type { ControlSelectOption } from "../../../components/ha-control-select" ;
10
11
import "../../../components/ha-control-select-menu" ;
11
12
import type { HaControlSelectMenu } from "../../../components/ha-control-select-menu" ;
12
- import {
13
- ClimateEntity ,
14
- ClimateEntityFeature ,
15
- computePresetModeIcon ,
16
- } from "../../../data/climate" ;
13
+ import { ClimateEntity , ClimateEntityFeature } from "../../../data/climate" ;
17
14
import { UNAVAILABLE } from "../../../data/entity" ;
18
15
import { HomeAssistant } from "../../../types" ;
19
16
import { LovelaceCardFeature , LovelaceCardFeatureEditor } from "../types" ;
@@ -138,7 +135,13 @@ class HuiClimatePresetModesCardFeature
138
135
"preset_mode" ,
139
136
mode
140
137
) ,
141
- path : computePresetModeIcon ( mode ) ,
138
+ icon : html `<ha- attribute-icon
139
+ slot= "graphic"
140
+ .hass = ${ this . hass }
141
+ .stateObj = ${ stateObj }
142
+ attribute= "preset_mode"
143
+ .attributeValue = ${ mode }
144
+ > </ ha- attribute-icon> ` ,
142
145
} ) ) ;
143
146
144
147
if ( this . _config . style === "icons" ) {
@@ -176,12 +179,21 @@ class HuiClimatePresetModesCardFeature
176
179
@selected = ${ this . _valueChanged }
177
180
@closed = ${ stopPropagation }
178
181
>
179
- <ha- svg- icon slot= "icon" .path = ${ mdiTuneVariant } > </ ha- svg- icon>
182
+ ${ this . _currentPresetMode
183
+ ? html `<ha- attribute-icon
184
+ slot= "icon"
185
+ .hass = ${ this . hass }
186
+ .stateObj = ${ stateObj }
187
+ attribute= "preset_mode"
188
+ .attributeValue = ${ this . _currentPresetMode }
189
+ > </ ha- attribute-icon> `
190
+ : html `
191
+ <ha- svg- icon slot= "icon" .path = ${ mdiTuneVariant } > </ ha- svg- icon>
192
+ ` }
180
193
${ options . map (
181
194
( option ) => html `
182
195
<ha- lis t- item .value = ${ option . value } graphic= "icon">
183
- <ha- svg- icon slot= "graphic" .path = ${ option . path } > </ ha- svg- icon>
184
- ${ option . label }
196
+ ${ option . icon } ${ option . label }
185
197
</ ha- lis t- item>
186
198
`
187
199
) }
0 commit comments