fix: Match state trigger/condition semantics to HA (#2565)

* Closes #2530
This commit is contained in:
Dermot Duffy
2026-07-04 10:23:51 -07:00
committed by GitHub
parent 3494706225
commit 9f956fe89f
15 changed files with 825 additions and 69 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ const isDict = (value: unknown): value is Record<string, unknown> =>
// that Python's `bool` is a subtype of `int`, so `true`/`false` equal `1`/`0`
// (and that equivalence propagates through nested lists/dicts). HA relies on
// it, so we must too for byte-for-byte parity.
const haEqual = (a: unknown, b: unknown): boolean =>
export const haEqual = (a: unknown, b: unknown): boolean =>
isEqualWith(a, b, (x, y) => {
if (typeof x === 'boolean' && typeof y === 'number') {
return Number(x) === y;