mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-12 20:40:29 +00:00
Fix localize key type errors for states (#14691)
* Replace unavailable state checks with type predicate * Remove localize exceptions related to state * Use literal types for climate attributes * Add fan action to climate tile badge * Use literal types for truncated states in badges * Use literal type for humidifier state * Replace unavailable state checks in calendar and tile card * Avoid string split for truncated key
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
TemplateResult,
|
||||
} from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
||||
import { isUnavailableState } from "../../../data/entity";
|
||||
import { canRun, ScriptEntity } from "../../../data/script";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||
@@ -65,7 +65,7 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow {
|
||||
${stateObj.state === "off" || stateObj.attributes.max
|
||||
? html`<mwc-button
|
||||
@click=${this._runScript}
|
||||
.disabled=${UNAVAILABLE_STATES.includes(stateObj.state) ||
|
||||
.disabled=${isUnavailableState(stateObj.state) ||
|
||||
!canRun(stateObj)}
|
||||
>
|
||||
${this._config.action_name ||
|
||||
|
||||
Reference in New Issue
Block a user