File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed
Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -880,22 +880,10 @@ async def clock_synchronize(self) -> bool:
880880 return False
881881
882882 dt_now = datetime .now (tz = UTC )
883- dt_now_date = dt_now .replace (hour = 0 , minute = 0 , second = 0 , microsecond = 0 )
884- response_date = datetime (
885- response .date .value .year ,
886- response .date .value .month ,
887- response .date .value .day ,
888- hour = 0 ,
889- minute = 0 ,
890- second = 0 ,
891- microsecond = 0 ,
892- tzinfo = UTC ,
893- )
894- if dt_now_date != response_date :
883+ if dt_now .weekday () != response .day_of_week .value :
895884 _LOGGER .info (
896- "Sync clock of node %s because time has drifted %s days " ,
885+ "Sync clock of node %s because time has drifted more than 1 day " ,
897886 self ._mac_in_str ,
898- int (abs ((dt_now_date - response_date ).days )),
899887 )
900888 return await self ._send_clock_set_req ()
901889
You can’t perform that action at this time.
0 commit comments