mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 10:26:35 +00:00
Allow controlling an input_select in unknown state (#13524)
This commit is contained in:
parent
e861460318
commit
cb5621032d
@ -4,7 +4,7 @@ import { customElement, property, state } from "lit/decorators";
|
||||
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
||||
import "../../../components/ha-select";
|
||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||
import { UNAVAILABLE } from "../../../data/entity";
|
||||
import { forwardHaptic } from "../../../data/haptics";
|
||||
import {
|
||||
InputSelectEntity,
|
||||
@ -61,7 +61,9 @@ class HuiInputSelectEntityRow extends LitElement implements LovelaceRow {
|
||||
<ha-select
|
||||
.label=${this._config.name || computeStateName(stateObj)}
|
||||
.value=${stateObj.state}
|
||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
||||
.disabled=${
|
||||
stateObj.state === UNAVAILABLE /* UNKNWON state is allowed */
|
||||
}
|
||||
naturalMenuWidth
|
||||
@selected=${this._selectedChanged}
|
||||
@click=${stopPropagation}
|
||||
|
@ -5,7 +5,7 @@ import { customElement, property } from "lit/decorators";
|
||||
import { stopPropagation } from "../common/dom/stop_propagation";
|
||||
import { computeStateName } from "../common/entity/compute_state_name";
|
||||
import "../components/entity/state-badge";
|
||||
import { UNAVAILABLE_STATES } from "../data/entity";
|
||||
import { UNAVAILABLE } from "../data/entity";
|
||||
import { InputSelectEntity, setInputSelectOption } from "../data/input_select";
|
||||
import type { HomeAssistant } from "../types";
|
||||
|
||||
@ -21,7 +21,9 @@ class StateCardInputSelect extends LitElement {
|
||||
<ha-select
|
||||
.label=${computeStateName(this.stateObj)}
|
||||
.value=${this.stateObj.state}
|
||||
.disabled=${UNAVAILABLE_STATES.includes(this.stateObj.state)}
|
||||
.disabled=${
|
||||
this.stateObj.state === UNAVAILABLE /* UNKNWON state is allowed */
|
||||
}
|
||||
naturalMenuWidth
|
||||
fixedMenuPosition
|
||||
@selected=${this._selectedOptionChanged}
|
||||
|
Loading…
x
Reference in New Issue
Block a user