From fc649b0d1aaff23597d98b86d755d3865003dc3a Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:30:14 +0100 Subject: [PATCH] Update timesyncsensor.go --- timesyncsensor/timesyncsensor.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/timesyncsensor/timesyncsensor.go b/timesyncsensor/timesyncsensor.go index 122d835..cb582b3 100644 --- a/timesyncsensor/timesyncsensor.go +++ b/timesyncsensor/timesyncsensor.go @@ -10,7 +10,6 @@ import ( "go.viam.com/rdk/components/sensor" "go.viam.com/rdk/logging" "go.viam.com/rdk/resource" - "go.viam.com/rdk/services/datamanager" "go.viam.com/utils" ) @@ -137,7 +136,7 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri hEnd, mEnd, sEnd, 0, zone) readings := map[string]interface{}{"should_sync": false} - readings["time"] = currentTime + readings["time"] = currentTime.String() // If it is between the start and end time, sync. if currentTime.After(startTime) && currentTime.Before(endTime) { s.logger.Debug("Syncing") @@ -146,7 +145,7 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri } // Otherwise, do not sync. - s.logger.Debug("Not syncing. Current time not in sync window: " + currentTime) + s.logger.Debug("Not syncing. Current time not in sync window: " + currentTime.String()) return readings, nil } @@ -154,4 +153,4 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri func (s *timeSyncer) Close(ctx context.Context) error { s.cancelFunc() return nil -} \ No newline at end of file +}