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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user