From 422c3857ef812ddd5efe138be46f66e719b6503d Mon Sep 17 00:00:00 2001 From: Cecille Freeman Date: Fri, 22 Sep 2023 09:39:06 -0400 Subject: [PATCH] Timesync: Force call to delegate so we get time source --- .../time-synchronization-server.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp index c7c79f3d1fc499..32c93ce3ca6505 100644 --- a/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp +++ b/src/app/clusters/time-synchronization-server/time-synchronization-server.cpp @@ -464,13 +464,10 @@ void TimeSynchronizationServer::Init() { ClearDSTOffset(); } - System::Clock::Microseconds64 utcTime; - if (System::SystemClock().GetClock_RealTime(utcTime) == CHIP_NO_ERROR && - !RuntimeOptionsProvider::Instance().GetSimulateNoInternalTime()) - { - mGranularity = GranularityEnum::kMinutesGranularity; - } + // Set the granularity to none for now - this will force us to go to the delegate so it can + // properly report the time source + mGranularity = GranularityEnum::kNoTimeGranularity; // This can error, but it's not clear what should happen in this case. For now, just ignore it because we still // want time sync even if we can't register the deletgate here.