Skip to content
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 MoveToLevelWithOnOff to only set the SceneGlobalControl to true i… #3

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,15 +761,14 @@ static EmberAfStatus moveToLevelHandler(EndpointId endpoint, CommandId commandId
schedule(endpoint, computeCallbackWaitTimeMs(state->callbackSchedule, state->eventDurationMs));
status = EMBER_ZCL_STATUS_SUCCESS;

if (commandId == Commands::MoveToLevelWithOnOff::Id)
#ifdef EMBER_AF_PLUGIN_ON_OFF
// Check that the received MoveToLevelWithOnOff produces a On action and that the onoff support the lighting featuremap
if (commandId == Commands::MoveToLevelWithOnOff::Id && state->moveToLevel != state->minLevel &&
OnOffServer::Instance().SupportsLightingApplications(endpoint))
{
uint32_t featureMap;
if (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS &&
READBITS(featureMap, EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING))
{
OnOff::Attributes::GlobalSceneControl::Set(endpoint, true);
}
OnOff::Attributes::GlobalSceneControl::Set(endpoint, true);
}
#endif // EMBER_AF_PLUGIN_ON_OFF

return status;
}
Expand Down