Skip to content

Commit 3da4402

Browse files
woody-applerestyled-commits
authored andcommitted
[nrf fromtree] When dimming a light/bulb over time or changing color the thread network can be spammed (#31778)
* Adding diff * Restyled by clang-format --------- Cherry picked commit: 935aa450 Co-authored-by: Restyled.io <commits@restyled.io>
1 parent c1d6f8a commit 3da4402

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
@@ -2565,6 +2565,24 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint)
25652565

25662566
isColorTempTransitionDone = computeNewColor16uValue(colorTempTransitionState);
25672567

2568+
if (!isColorTempTransitionDone)
2569+
{
2570+
// Check whether our color temperature has actually changed. If not, do
2571+
// nothing, and wait for it to change.
2572+
uint16_t currentColorTemp;
2573+
if (Attributes::ColorTemperatureMireds::Get(endpoint, &currentColorTemp) != EMBER_ZCL_STATUS_SUCCESS)
2574+
{
2575+
// Why can't we read our attribute?
2576+
return;
2577+
}
2578+
2579+
if (currentColorTemp == colorTempTransitionState->currentValue)
2580+
{
2581+
scheduleTimerCallbackMs(configureTempEventControl(endpoint), TRANSITION_UPDATE_TIME_MS.count());
2582+
return;
2583+
}
2584+
}
2585+
25682586
Attributes::RemainingTime::Set(endpoint, colorTempTransitionState->timeRemaining);
25692587

25702588
if (isColorTempTransitionDone)

0 commit comments

Comments
 (0)