mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Fix number entity row availability when state unknown (#9475)
This commit is contained in:
parent
0a83a704f1
commit
43503ba085
@ -11,7 +11,7 @@ import { customElement, property, state } from "lit/decorators";
|
|||||||
import { computeStateDisplay } from "../../../common/entity/compute_state_display";
|
import { computeStateDisplay } from "../../../common/entity/compute_state_display";
|
||||||
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||||
import "../../../components/ha-slider";
|
import "../../../components/ha-slider";
|
||||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
import { UNAVAILABLE } from "../../../data/entity";
|
||||||
import { setValue } from "../../../data/input_text";
|
import { setValue } from "../../../data/input_text";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||||
@ -75,7 +75,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow {
|
|||||||
? html`
|
? html`
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<ha-slider
|
<ha-slider
|
||||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
.disabled=${stateObj.state === UNAVAILABLE}
|
||||||
.dir=${computeRTLDirection(this.hass)}
|
.dir=${computeRTLDirection(this.hass)}
|
||||||
.step="${Number(stateObj.attributes.step)}"
|
.step="${Number(stateObj.attributes.step)}"
|
||||||
.min="${Number(stateObj.attributes.min)}"
|
.min="${Number(stateObj.attributes.min)}"
|
||||||
@ -101,7 +101,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow {
|
|||||||
<paper-input
|
<paper-input
|
||||||
no-label-float
|
no-label-float
|
||||||
auto-validate
|
auto-validate
|
||||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
|
.disabled=${stateObj.state === UNAVAILABLE}
|
||||||
pattern="[0-9]+([\\.][0-9]+)?"
|
pattern="[0-9]+([\\.][0-9]+)?"
|
||||||
.step="${Number(stateObj.attributes.step)}"
|
.step="${Number(stateObj.attributes.step)}"
|
||||||
.min="${Number(stateObj.attributes.min)}"
|
.min="${Number(stateObj.attributes.min)}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user