fix validate-condition: unavailable -> unknown (#24749)

unavailable -> unknown
This commit is contained in:
ildar170975 2025-03-24 11:36:05 +03:00 committed by GitHub
parent 420477e416
commit dc5bb899d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@ import { ensureArray } from "../../../common/array/ensure-array";
import type { MediaQueriesListener } from "../../../common/dom/media_query";
import { listenMediaQuery } from "../../../common/dom/media_query";
import { isValidEntityId } from "../../../common/entity/valid_entity_id";
import { UNAVAILABLE } from "../../../data/entity";
import { UNKNOWN } from "../../../data/entity";
import type { HomeAssistant } from "../../../types";
export type Condition =
@ -75,7 +75,7 @@ function checkStateCondition(
const state =
condition.entity && hass.states[condition.entity]
? hass.states[condition.entity].state
: UNAVAILABLE;
: UNKNOWN;
let value = condition.state ?? condition.state_not;
// Handle entity_id, UI should be updated for conditional card (filters does not have UI for now)