Skip to content

Commit 0b7fba1

Browse files
Moved the scenes-handler registration outside of the #ifndef IGNORE_ON_OFF_CLUSTER_START_UP_ON_OFF condition
1 parent 1b7bd1f commit 0b7fba1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/app/clusters/on-off-server/on-off-server.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,6 @@ void OnOffServer::initOnOffServer(chip::EndpointId endpoint)
520520
status = setOnOffValue(endpoint, onOffValueForStartUp, true);
521521
}
522522

523-
#if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS
524-
// Registers Scene handlers for the On/Off cluster on the server
525-
app::Clusters::ScenesManagement::ScenesServer::Instance().RegisterSceneHandler(endpoint,
526-
OnOffServer::Instance().GetSceneHandler());
527-
#endif // defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS
528-
529523
#ifdef MATTER_DM_PLUGIN_MODE_SELECT
530524
// If OnMode is not a null value, then change the current mode to it.
531525
if (onOffValueForStartUp && emberAfContainsServer(endpoint, ModeSelect::Id) &&
@@ -542,6 +536,12 @@ void OnOffServer::initOnOffServer(chip::EndpointId endpoint)
542536
}
543537
#endif // IGNORE_ON_OFF_CLUSTER_START_UP_ON_OFF
544538

539+
#if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS
540+
// Registers Scene handlers for the On/Off cluster on the server
541+
app::Clusters::ScenesManagement::ScenesServer::Instance().RegisterSceneHandler(endpoint,
542+
OnOffServer::Instance().GetSceneHandler());
543+
#endif // defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS
544+
545545
emberAfPluginOnOffClusterServerPostInitCallback(endpoint);
546546
}
547547

@@ -973,8 +973,8 @@ static inline void unreg(OnOffEffect * inst)
973973

974974
OnOffEffect::OnOffEffect(chip::EndpointId endpoint, OffWithEffectTriggerCommand offWithEffectTrigger,
975975
EffectIdentifierEnum effectIdentifier, uint8_t effectVariant) :
976-
mEndpoint(endpoint),
977-
mOffWithEffectTrigger(offWithEffectTrigger), mEffectIdentifier(effectIdentifier), mEffectVariant(effectVariant)
976+
mEndpoint(endpoint), mOffWithEffectTrigger(offWithEffectTrigger), mEffectIdentifier(effectIdentifier),
977+
mEffectVariant(effectVariant)
978978
{
979979
reg(this);
980980
};

0 commit comments

Comments
 (0)