Skip to content

Commit 66ea341

Browse files
committed
Improve clock-sync related log messages
1 parent e12211a commit 66ea341

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ async def clock_synchronize(self) -> bool:
894894
return True
895895

896896
_LOGGER.warning(
897-
"Reset realtime clock of node %s because time drifted %s seconds (max %s seconds)",
897+
"Sync clock of node %s because time drifted %s seconds",
898898
self._mac_in_str,
899899
str(int(abs(clock_offset.total_seconds()))),
900900
str(MAX_TIME_DRIFT),
@@ -912,10 +912,7 @@ async def clock_synchronize(self) -> bool:
912912
)
913913
if (node_response := await set_request.send()) is not None:
914914
return node_response.ack_id == NodeResponseType.CLOCK_ACCEPTED
915-
_LOGGER.warning(
916-
"Failed to (re)set the internal realtime clock of %s",
917-
self.name,
918-
)
915+
_LOGGER.debug("Failed to sync the clock of %s", self.name)
919916
return False
920917

921918
async def load(self) -> None:

plugwise_usb/nodes/circle_plus.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def clock_synchronize(self) -> bool:
7070
request = CirclePlusRealTimeClockGetRequest(self._send, self._mac_in_bytes)
7171
if (response := await request.send()) is None:
7272
_LOGGER.debug(
73-
"No response for async_realtime_clock_synchronize() for %s", self.mac
73+
"No response for clock_synchronize() for %s", self._mac_in_str
7474
)
7575
await self._available_update_state(False)
7676
return False
@@ -90,7 +90,7 @@ async def clock_synchronize(self) -> bool:
9090
)
9191
if dt_now_date != response_date:
9292
_LOGGER.warning(
93-
"Reset realtime clock of node %s because time has drifted %s days",
93+
"Sync clock of node %s because time has drifted %s days",
9494
self._mac_in_str,
9595
int(abs((dt_now_date - response_date).days)),
9696
)
@@ -108,7 +108,7 @@ async def clock_synchronize(self) -> bool:
108108
return True
109109

110110
_LOGGER.warning(
111-
"Reset realtime clock of node %s because time drifted %s seconds (max %s seconds)",
111+
"Sync clock of node %s because time drifted %s seconds",
112112
self._mac_in_str,
113113
int(abs(clock_offset.total_seconds())),
114114
MAX_TIME_DRIFT,
@@ -122,10 +122,7 @@ async def _send_clock_set_req(self) -> bool:
122122
)
123123
if (node_response := await set_request.send()) is not None:
124124
return node_response.ack_id == NodeResponseType.CLOCK_ACCEPTED
125-
_LOGGER.warning(
126-
"Failed to (re)set the internal realtime clock of %s",
127-
self.name,
128-
)
125+
_LOGGER.debug("Failed to sync the clock of %s", self.name)
129126
return False
130127

131128
@raise_not_loaded

0 commit comments

Comments
 (0)