-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OnOff state shadowing by the LevelControl cluster while OnOff tra… #36922
base: master
Are you sure you want to change the base?
Conversation
@@ -1425,22 +1436,55 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new | |||
transitionTime.SetNull(); | |||
#endif // IGNORE_LEVEL_CONTROL_CLUSTER_ON_OFF_TRANSITION_TIME | |||
|
|||
// Check if we're already performing an on/off transition. | |||
if (state->commandIsOnOff) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to introduce some state instead of comparing the moveToLevel
against the limits?
PR #36922: Size comparison from c1afc02 to 94b7b33 Full report (31 builds for cc32xx, linux, nrfconnect, stm32, telink, tizen)
|
PR #36922: Size comparison from c1afc02 to 61bf11c Full report (31 builds for cc32xx, linux, nrfconnect, stm32, telink, tizen)
|
PR #36922: Size comparison from c1afc02 to 10a81a9 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
// | ||
// this restriction does not exist for the "Off" command since level movements by definition | ||
// are only available while the OnOff state is "On". | ||
if (!LevelControlWithOnOffFeaturePresent(endpoint) || (command == Commands::Off::Id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be necessary to restrict this to lighting applications in the future. I don't, however, see how not having this behavior can be useful for other applications - but I might be missing the bigger picture here.
…nsitions are in progress
PR #36922: Size comparison from c1afc02 to aac41fc Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Description
The
LevelControl
server shadows theOnOff
state if it is performing an On/Off transition and incorrectly changes theCurrentLevel
in case an On transition is interrupted by anOnOff::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 theLevelControl
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
andOnOff
clusters.