Make input_text entity row usable when value is "unknown" (#8258)

This commit is contained in:
Thomas Lovén 2021-01-28 14:05:07 +01:00 committed by GitHub
parent d4000cf662
commit f02841409c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ import {
PropertyValues,
TemplateResult,
} from "lit-element";
import { UNAVAILABLE_STATES } from "../../../data/entity";
import { UNAVAILABLE } from "../../../data/entity";
import { setValue } from "../../../data/input_text";
import { HomeAssistant } from "../../../types";
import { hasConfigOrEntityChanged } from "../common/has-changed";
@ -54,7 +54,7 @@ class HuiInputTextEntityRow extends LitElement implements LovelaceRow {
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
<paper-input
no-label-float
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state)}
.disabled=${stateObj.state === UNAVAILABLE}
.value="${stateObj.state}"
.minlength="${stateObj.attributes.min}"
.maxlength="${stateObj.attributes.max}"