Removed un-necessary check (#36234)
diff --git a/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp
index c751c71..cf7e480 100644
--- a/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp
+++ b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp
@@ -196,12 +196,12 @@
{
if (gEPMDelegate)
{
- uint16_t updateState = to_underlying(state);
- uint16_t ERROR_STATE_INDEX = ArraySize(kAttributes) - 1;
+ uint8_t updateState = to_underlying(state);
+
// Check state range
- if ((updateState < 0) || (updateState > ERROR_STATE_INDEX))
+ if (updateState >= ArraySize(kAttributes))
{
- updateState = ERROR_STATE_INDEX;
+ updateState = ArraySize(kAttributes) - 1;
}
ChipLogDetail(AppServer, "UpdateAllAttributes to Operational State : %d", updateState);