Skip to content

Commit 9078821

Browse files
committed
import random
1 parent 22cbfee commit 9078821

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from datetime import UTC, datetime, timedelta
99
from functools import wraps
1010
import logging
11+
import random
1112
from math import ceil
1213
from typing import Any, Final, TypeVar, cast
1314

@@ -860,7 +861,7 @@ async def _clock_synchronize_scheduler(self) -> None:
860861
"""Background task: periodically synchronize the clock until cancelled."""
861862
try:
862863
while True:
863-
await sleep(CLOCK_SYNC_PERIOD + (random.uniform(-5, 5)))
864+
await sleep(CLOCK_SYNC_PERIOD + random.uniform(-5, 5))
864865
try:
865866
await self.clock_synchronize()
866867
except Exception:
@@ -895,7 +896,7 @@ async def clock_synchronize(self) -> bool:
895896
)
896897
if self._node_protocols is None:
897898
raise NodeError(
898-
"Unable to synchronize clock en when protocol version is unknown"
899+
"Unable to synchronize clock when protocol version is unknown"
899900
)
900901
set_clock_request = CircleClockSetRequest(
901902
self._send,

0 commit comments

Comments
 (0)