Skip to content

Commit 935aa45

Browse files
When dimming a light/bulb over time or changing color the thread network can be spammed (#31778)
* Adding diff * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 506865d commit 935aa45

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/app/clusters/color-control-server/color-control-server.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -2602,6 +2602,24 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint)
26022602

26032603
isColorTempTransitionDone = computeNewColor16uValue(colorTempTransitionState);
26042604

2605+
if (!isColorTempTransitionDone)
2606+
{
2607+
// Check whether our color temperature has actually changed. If not, do
2608+
// nothing, and wait for it to change.
2609+
uint16_t currentColorTemp;
2610+
if (Attributes::ColorTemperatureMireds::Get(endpoint, &currentColorTemp) != EMBER_ZCL_STATUS_SUCCESS)
2611+
{
2612+
// Why can't we read our attribute?
2613+
return;
2614+
}
2615+
2616+
if (currentColorTemp == colorTempTransitionState->currentValue)
2617+
{
2618+
scheduleTimerCallbackMs(configureTempEventControl(endpoint), TRANSITION_UPDATE_TIME_MS.count());
2619+
return;
2620+
}
2621+
}
2622+
26052623
Attributes::RemainingTime::Set(endpoint, colorTempTransitionState->timeRemaining);
26062624

26072625
if (isColorTempTransitionDone)

0 commit comments

Comments
 (0)