|
39 | 39 |
|
40 | 40 | #include <app-common/zap-generated/attributes/Accessors.h> |
41 | 41 | #include <platform/CHIPDeviceLayer.h> |
| 42 | +#include <platform/silabs/platformAbstraction/SilabsPlatform.h> |
42 | 43 |
|
43 | 44 | #define MAX_TEMPERATURE 30000 |
44 | 45 | #define MIN_TEMPERATURE 0 |
@@ -72,24 +73,6 @@ void OvenManager::Init() |
72 | 73 |
|
73 | 74 | VerifyOrReturn(mCookTopEndpoint.Init() == CHIP_NO_ERROR, ChipLogError(AppServer, "CookTopEndpoint Init failed")); |
74 | 75 |
|
75 | | - // Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure) |
76 | | - { |
77 | | - Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0); |
78 | | - VerifyOrReturn(tcStatus == Status::Success, |
79 | | - ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed")); |
80 | | - |
81 | | - tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0); |
82 | | - VerifyOrReturn(tcStatus == Status::Success, |
83 | | - ChipLogError(AppServer, "Endpoint2 MinTemperature init failed")); |
84 | | - |
85 | | - tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000); |
86 | | - VerifyOrReturn(tcStatus == Status::Success, |
87 | | - ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed")); |
88 | | - |
89 | | - tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500); |
90 | | - VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed")); |
91 | | - } |
92 | | - |
93 | 76 | // Register the shared TemperatureLevelsDelegate for all the cooksurface endpoints |
94 | 77 | TemperatureControl::SetInstance(&mTemperatureControlDelegate); |
95 | 78 |
|
@@ -188,6 +171,16 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId |
188 | 171 | // Update CookSurface states accordingly |
189 | 172 | mCookSurfaceEndpoint1.SetOnOffState(*value); |
190 | 173 | mCookSurfaceEndpoint2.SetOnOffState(*value); |
| 174 | + |
| 175 | + // Trigger binding for CookTop OnOff changes |
| 176 | + { |
| 177 | + OnOffBindingContext * context = Platform::New<OnOffBindingContext>(); |
| 178 | + |
| 179 | + context->localEndpointId = kCookTopEndpoint; |
| 180 | + context->commandId = *value ? Clusters::OnOff::Commands::On::Id : Clusters::OnOff::Commands::Off::Id; |
| 181 | + |
| 182 | + CookTopOnOffBindingTrigger(context); |
| 183 | + } |
191 | 184 | break; |
192 | 185 | case kCookSurfaceEndpoint1: |
193 | 186 | case kCookSurfaceEndpoint2: |
|
0 commit comments