Fix OnOff state shadowing by the LevelControl cluster while OnOff tra… #36924
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The LevelControl server shadows the OnOff state if it is performing an On/Off transition and incorrectly changes the CurrentLevel in case an On transition is interrupted by an OnOff::Command::Off.
In short: When receiving a new command, the CurrentLevel is updated with the temporary level that is used by an On/Off effect transition. For lighting applications this is very undesirable since you don't want to change the lighting level just because you pushed the On/Off switch while a dimming effect was in progress.
Fixes/see #36579
Discussion
This PR introduces a new emberAfOnOffClusterLevelControlIsEffectActiveCallback - I didn't know what else to use since the information about a state transition is stored in the LevelControl cluster.
I'm also not very happy with the way I'm checking whether a transition is in progress (comparing against the levels) but I didn't want to introduce too many breaking changes to the state information tracked by the LevelControl and OnOff clusters.