Repository navigation
[SL-TEMP] MATTER-5950: Multi sensor app refactor (#1033) - #1260
Conversation
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit c10219e. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Wrong display enable macro used
- Replaced all instances of #ifdef DISPLAY_ENABLED with #if SL_MATTER_DISPLAY_ENABLED to properly gate LCD code compilation.
- ✅ Fixed: Stale copyright year on new files
- Updated copyright year from 2024 to 2026 in AppTaskImpl.h and SensorConfig.h to reflect their creation year.
Or push these changes by commenting:
@cursor push ee1826a976
Preview (ee1826a976)
diff --git a/examples/multi-sensor-app/silabs/include/AppTask.h b/examples/multi-sensor-app/silabs/include/AppTask.h
--- a/examples/multi-sensor-app/silabs/include/AppTask.h
+++ b/examples/multi-sensor-app/silabs/include/AppTask.h
@@ -142,7 +142,7 @@
*/
bool IsOccupancyDetected();
-#ifdef DISPLAY_ENABLED
+#if SL_MATTER_DISPLAY_ENABLED
/**
* @brief LCD callback function to cycle LCD display.
* Function switch to the next LCD UI and update the show values.
diff --git a/examples/multi-sensor-app/silabs/include/AppTaskImpl.h b/examples/multi-sensor-app/silabs/include/AppTaskImpl.h
--- a/examples/multi-sensor-app/silabs/include/AppTaskImpl.h
+++ b/examples/multi-sensor-app/silabs/include/AppTaskImpl.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2024 Project CHIP Authors
+ * Copyright (c) 2026 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/examples/multi-sensor-app/silabs/include/SensorConfig.h b/examples/multi-sensor-app/silabs/include/SensorConfig.h
--- a/examples/multi-sensor-app/silabs/include/SensorConfig.h
+++ b/examples/multi-sensor-app/silabs/include/SensorConfig.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2024 Project CHIP Authors
+ * Copyright (c) 2026 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/examples/multi-sensor-app/silabs/src/AppTask.cpp b/examples/multi-sensor-app/silabs/src/AppTask.cpp
--- a/examples/multi-sensor-app/silabs/src/AppTask.cpp
+++ b/examples/multi-sensor-app/silabs/src/AppTask.cpp
@@ -54,7 +54,7 @@
#include <crypto/RandUtils.h>
#endif // defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR
-#if defined(DISPLAY_ENABLED) && DISPLAY_ENABLED
+#if SL_MATTER_DISPLAY_ENABLED
#include <SensorsUI.h>
#endif
@@ -225,7 +225,7 @@
break;
}
}
-#endif // DISPLAY_ENABLED
+#endif // SL_MATTER_DISPLAY_ENABLED
void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction)
{
@@ -302,9 +302,9 @@
VerifyOrReturn(aEvent != nullptr);
VerifyOrReturn(aEvent->Type == AppEvent::kEventType_SensorAttributeUpdate);
-#ifdef DISPLAY_ENABLED
+#if SL_MATTER_DISPLAY_ENABLED
GetAppTask().UpdateSensorDisplay();
-#endif // DISPLAY_ENABLED
+#endif // SL_MATTER_DISPLAY_ENABLED
}
void AppTask::OccupancyAttributeUpdateEvent(AppEvent * aEvent)
@@ -314,9 +314,9 @@
sOccupancyLed.Set(aEvent->OccupancyEvent.occupancyDetected);
-#ifdef DISPLAY_ENABLED
+#if SL_MATTER_DISPLAY_ENABLED
GetAppTask().UpdateSensorDisplay();
-#endif // DISPLAY_ENABLED
+#endif // SL_MATTER_DISPLAY_ENABLED
}
void AppTask::TriggerSensorAction(chip::System::Layer * aLayer, void * aAppState)You can send follow-ups to the cloud agent here.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c10219e. Configure here.
good point, updated this and oven accordingly |
* initial consolidation into AppTask * implement CRTP architecture * Restyled by whitespace * fix drift for sensor manager initalization * add missing include * SensorActionTriggered -> TriggerSensorAction * consolidate repeated code into helper functions * register OnAttributeChanged in AppTask * wrap simulated value on kAttributeChangeReportThreshold < 3 --------- Co-authored-by: Restyled.io <commits@restyled.io>
- Replace all instances of #ifdef DISPLAY_ENABLED with #if SL_MATTER_DISPLAY_ENABLED to properly gate LCD/display code (DISPLAY_ENABLED=0 would still compile with #ifdef) - Update copyright year from 2024 to 2026 in AppTaskImpl.h and SensorConfig.h (new files created in 2026) Applied via @cursor push command
c5a2f37 to
8230a5e
Compare
c55d6a5
into
release_2.10-1.6.1


cherry-pick #1033
Summary
Related issues
MATTER-5950
Testing
CI (full run with smoke)
Local testing of overrides