mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 14:26:35 +00:00
Fix humidifier more info mode dropdown (#11964)
This commit is contained in:
parent
2e10eb04b6
commit
dfcb0f6ba0
@ -1,3 +1,4 @@
|
|||||||
|
import "@material/mwc-list/mwc-list-item";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
@ -12,6 +13,7 @@ import { fireEvent } from "../../../common/dom/fire_event";
|
|||||||
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
||||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
import { supportsFeature } from "../../../common/entity/supports-feature";
|
||||||
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||||
|
import "../../../components/ha-select";
|
||||||
import "../../../components/ha-slider";
|
import "../../../components/ha-slider";
|
||||||
import "../../../components/ha-switch";
|
import "../../../components/ha-switch";
|
||||||
import {
|
import {
|
||||||
@ -19,8 +21,6 @@ import {
|
|||||||
HUMIDIFIER_SUPPORT_MODES,
|
HUMIDIFIER_SUPPORT_MODES,
|
||||||
} from "../../../data/humidifier";
|
} from "../../../data/humidifier";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import "@material/mwc-list/mwc-list";
|
|
||||||
import "@material/mwc-list/mwc-list-item";
|
|
||||||
|
|
||||||
class MoreInfoHumidifier extends LitElement {
|
class MoreInfoHumidifier extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
@ -67,26 +67,24 @@ class MoreInfoHumidifier extends LitElement {
|
|||||||
|
|
||||||
${supportModes
|
${supportModes
|
||||||
? html`
|
? html`
|
||||||
<div class="container-modes">
|
<ha-select
|
||||||
<mwc-list
|
.label=${hass.localize("ui.card.humidifier.mode")}
|
||||||
.label=${hass.localize("ui.card.humidifier.mode")}
|
.value=${stateObj.attributes.mode}
|
||||||
.value=${stateObj.attributes.mode}
|
fixedMenuPosition
|
||||||
fixedMenuPosition
|
naturalMenuWidth
|
||||||
naturalMenuWidth
|
@selected=${this._handleModeChanged}
|
||||||
@selected=${this._handleModeChanged}
|
@closed=${stopPropagation}
|
||||||
@closed=${stopPropagation}
|
>
|
||||||
>
|
${stateObj.attributes.available_modes!.map(
|
||||||
${stateObj.attributes.available_modes!.map(
|
(mode) => html`
|
||||||
(mode) => html`
|
<mwc-list-item .value=${mode}>
|
||||||
<mwc-list-item .value=${mode}>
|
${hass.localize(
|
||||||
${hass.localize(
|
`state_attributes.humidifier.mode.${mode}`
|
||||||
`state_attributes.humidifier.mode.${mode}`
|
) || mode}
|
||||||
) || mode}
|
</mwc-list-item>
|
||||||
</mwc-list-item>
|
`
|
||||||
`
|
)}
|
||||||
)}
|
</ha-select>
|
||||||
</mwc-list>
|
|
||||||
</div>
|
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user