Skip to content

Commit b9ee16d

Browse files
committed
fix(thermostat-server): notify subscribers when ActivePresetHandle changes
SetActivePreset() was calling delegate->SetActivePresetHandle() without notifying the reporting engine, so active subscriptions never received a Report Data message after a SetActivePresetRequest command. The new value was silently applied on the device side (confirmed via a direct read) but was invisible to subscribed controllers. Add a call to MatterReportingAttributeChangeCallback() after a successful SetActivePresetHandle() to mark the attribute dirty and trigger a subscription report to all subscribers.
1 parent 704d97f commit b9ee16d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/app/clusters/thermostat-server/ThermostatClusterPresets.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "ThermostatClusterPresets.h"
1919
#include "ThermostatCluster.h"
2020

21+
#include <app/reporting/reporting.h>
2122
#include <platform/internal/CHIPDeviceLayerInternal.h>
2223

2324
using namespace chip;
@@ -316,6 +317,10 @@ Status ThermostatAttrAccess::SetActivePreset(EndpointId endpoint, DataModel::Nul
316317
return StatusIB(err).mStatus;
317318
}
318319

320+
// Notify subscribers that ActivePresetHandle has changed so that they
321+
// receive a subscription report with the new value.
322+
MatterReportingAttributeChangeCallback(endpoint, Thermostat::Id, ActivePresetHandle::Id);
323+
319324
return Status::Success;
320325
}
321326

0 commit comments

Comments
 (0)