Skip to content

Commit ae38472

Browse files
fessehaevececille
andauthored
clear dstoffset when DSTOffsetRequired is true (project-chip#28654)
Co-authored-by: C Freeman <cecille@google.com>
1 parent d0da504 commit ae38472

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/app/clusters/time-synchronization-server/time-synchronization-server.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -925,19 +925,24 @@ bool emberAfTimeSynchronizationClusterSetTimeZoneCallback(
925925
}
926926
else
927927
{
928-
TimeState dstState = TimeSynchronizationServer::Instance().UpdateDSTOffsetState();
929-
TimeSynchronizationServer::Instance().ClearDSTOffset();
930-
if (dstState == TimeState::kActive || dstState == TimeState::kChanged)
931-
{
932-
emitDSTStatusEvent(commandPath.mEndpointId, false);
933-
}
934928
response.DSTOffsetRequired = true;
935929
}
936930
}
937931
else
938932
{
939933
response.DSTOffsetRequired = true;
940934
}
935+
936+
if (response.DSTOffsetRequired)
937+
{
938+
TimeState dstState = TimeSynchronizationServer::Instance().UpdateDSTOffsetState();
939+
TimeSynchronizationServer::Instance().ClearDSTOffset();
940+
if (dstState == TimeState::kActive || dstState == TimeState::kChanged)
941+
{
942+
emitDSTStatusEvent(commandPath.mEndpointId, false);
943+
}
944+
}
945+
941946
commandObj->AddResponse(commandPath, response);
942947
return true;
943948
}

0 commit comments

Comments
 (0)