fix: support registryless opening entities

Issue: #117
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-08-19 02:12:37 +03:00
parent 9baf533c90
commit 01fe48de00
14 changed files with 283 additions and 32 deletions
+5 -3
View File
@@ -532,15 +532,17 @@ export function openingEntityAvailable(
/**
* Frame-local counterpart of `openingEntityAvailable`. The caller supplies an
* immutable active-registry projection, so both the registry row and state
* must belong to the same painted frame. Registry-less render parity is #117.
* immutable active-registry projection. State presence in that projection is
* sufficient evidence for an exact opening reference: YAML entities without
* unique_id have no registry row, while explicit disabled/orphan rows have
* already had their states removed by `activeRegistryHass`. Never call this
* helper with raw live hass; every read must belong to one painted frame.
*/
export function renderOpeningEntityAvailable(
projectedHass: any,
entityId: string | null | undefined,
): boolean {
return !!entityId
&& !!projectedHass?.entities?.[entityId]
&& !!projectedHass?.states?.[entityId];
}