fix: Change the not condition to exactly match the HA not condition (#2387)

BREAKING CHANGE: Changes the behavior of the `not` condition when there
is more than one condition present. Users who desire the previous
behavior should wrap their conditions in an `and` first.

 - Closes: #2383
This commit is contained in:
Dermot Duffy
2026-03-01 20:39:03 -08:00
committed by GitHub
parent 526acf7688
commit ecc8ecfd7e
3 changed files with 19 additions and 12 deletions
+2 -2
View File
@@ -331,13 +331,13 @@ export class ConditionsManager implements ConditionsManagerReadonlyInterface {
return { result: true, triggerData };
}
case 'not': {
// "Not" is just an inversed `and`. There is no trigger data for "not
// "Not" is an inverted `or` (NOR). There is no trigger data for "not
// triggering".
return {
result: !this._evaluateCondition(
{
...condition,
condition: 'and',
condition: 'or',
},
newState,
oldState,