|
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 |
@@ -74,19 +75,19 @@ void OvenManager::Init() |
74 | 75 |
|
75 | 76 | // Initialize TemperatureControl cluster numeric temperature attributes for endpoint 2 (silent on failure) |
76 | 77 | { |
77 | | - Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint2, 0); |
| 78 | + Status tcStatus = TemperatureControl::Attributes::TemperatureSetpoint::Set(kTemperatureControlledCabinetEndpoint, 0); |
78 | 79 | VerifyOrReturn(tcStatus == Status::Success, |
79 | 80 | ChipLogError(AppServer, "Endpoint2 TemperatureSetpoint init failed")); |
80 | 81 |
|
81 | | - tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint2, 0); |
| 82 | + tcStatus = TemperatureControl::Attributes::MinTemperature::Set(kTemperatureControlledCabinetEndpoint, 0); |
82 | 83 | VerifyOrReturn(tcStatus == Status::Success, |
83 | 84 | ChipLogError(AppServer, "Endpoint2 MinTemperature init failed")); |
84 | 85 |
|
85 | | - tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint2, 30000); |
| 86 | + tcStatus = TemperatureControl::Attributes::MaxTemperature::Set(kTemperatureControlledCabinetEndpoint, 30000); |
86 | 87 | VerifyOrReturn(tcStatus == Status::Success, |
87 | 88 | ChipLogError(AppServer, "Endpoint2 MaxTemperature init failed")); |
88 | 89 |
|
89 | | - tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint2, 500); |
| 90 | + tcStatus = TemperatureControl::Attributes::Step::Set(kTemperatureControlledCabinetEndpoint, 500); |
90 | 91 | VerifyOrReturn(tcStatus == Status::Success, ChipLogError(AppServer, "Endpoint2 Step init failed")); |
91 | 92 | } |
92 | 93 |
|
@@ -188,6 +189,16 @@ void OvenManager::OnOffAttributeChangeHandler(EndpointId endpointId, AttributeId |
188 | 189 | // Update CookSurface states accordingly |
189 | 190 | mCookSurfaceEndpoint1.SetOnOffState(*value); |
190 | 191 | mCookSurfaceEndpoint2.SetOnOffState(*value); |
| 192 | + |
| 193 | + // Trigger binding for CookTop OnOff changes |
| 194 | + { |
| 195 | + OnOffBindingContext * context = Platform::New<OnOffBindingContext>(); |
| 196 | + |
| 197 | + context->localEndpointId = kCookTopEndpoint; |
| 198 | + context->commandId = *value ? Clusters::OnOff::Commands::On::Id : Clusters::OnOff::Commands::Off::Id; |
| 199 | + |
| 200 | + CookTopOnOffBindingTrigger(context); |
| 201 | + } |
191 | 202 | break; |
192 | 203 | case kCookSurfaceEndpoint1: |
193 | 204 | case kCookSurfaceEndpoint2: |
|
0 commit comments