Skip to content

Commit d39d00f

Browse files
Moved the scenes-handler registration outside of the #ifndef IGNORE_ON_OFF_CLUSTER_START_UP_ON_OFF condition
1 parent b2a86bd commit d39d00f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
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

0 commit comments

Comments
 (0)