[HVAC] Set thermostat delegate in thermostat app (#35230)
diff --git a/examples/thermostat/linux/main.cpp b/examples/thermostat/linux/main.cpp
index b9f8269..3983d2b 100644
--- a/examples/thermostat/linux/main.cpp
+++ b/examples/thermostat/linux/main.cpp
@@ -21,6 +21,9 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
+#include <app/clusters/thermostat-server/thermostat-server.h>
+
+#include "thermostat-delegate-impl.h"
using namespace chip;
using namespace chip::app;
@@ -78,3 +81,12 @@
ChipLinuxAppMainLoop();
return 0;
}
+
+using namespace chip::app::Clusters::Thermostat;
+void emberAfThermostatClusterInitCallback(EndpointId endpoint)
+{
+ // Register the delegate for the Thermostat
+ auto & delegate = ThermostatDelegate::GetInstance();
+
+ SetDefaultDelegate(endpoint, &delegate);
+}