Skip to content

Commit a993b63

Browse files
author
autoruff
committed
fixup: test_bouwew Python code reformatted using Ruff
1 parent 1984c84 commit a993b63

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ async def clock_synchronize(self) -> bool:
882882
dt_now = datetime.now(tz=UTC)
883883
days_diff = (response.day_of_week.value - dt_now.weekday()) % 7
884884
circle_plus_timestamp: datetime = dt_now.replace(
885-
day=dt_now.day + days_diff,
885+
day=dt_now.day + days_diff,
886886
hour=response.time.value.hour,
887887
minute=response.time.value.minute,
888888
second=response.time.value.second,

plugwise_usb/nodes/circle_plus.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ async def load(self) -> bool:
6767

6868
async def clock_synchronize(self) -> bool:
6969
"""Synchronize realtime clock. Returns true if successful."""
70-
request = CirclePlusRealTimeClockGetRequest(
71-
self._send, self._mac_in_bytes
72-
)
70+
request = CirclePlusRealTimeClockGetRequest(self._send, self._mac_in_bytes)
7371
if (response := await request.send()) is None:
7472
_LOGGER.debug(
7573
"No response for async_realtime_clock_synchronize() for %s", self.mac
@@ -81,16 +79,14 @@ async def clock_synchronize(self) -> bool:
8179
dt_now = datetime.now(tz=UTC)
8280
days_diff = (response.day_of_week.value - dt_now.weekday()) % 7
8381
circle_plus_timestamp: datetime = dt_now.replace(
84-
day=(dt_now.day + days_diff),
82+
day=(dt_now.day + days_diff),
8583
hour=response.time.value.hour,
8684
minute=response.time.value.minute,
8785
second=response.time.value.second,
8886
microsecond=0,
8987
tzinfo=UTC,
9088
)
91-
clock_offset = (
92-
response.timestamp.replace(microsecond=0) - circle_plus_timestamp
93-
)
89+
clock_offset = response.timestamp.replace(microsecond=0) - circle_plus_timestamp
9490
if abs(clock_offset.total_seconds()) < MAX_TIME_DRIFT:
9591
return True
9692

tests/stick_test_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
# test using utc timezone
99
utc_now = datetime.now(tz=UTC).replace(tzinfo=UTC)
10-
utc_now_offset = datetime.now(tz=UTC).replace(tzinfo=UTC) + timedelta(days=1, hours=4, seconds=30)
10+
utc_now_offset = datetime.now(tz=UTC).replace(tzinfo=UTC) + timedelta(
11+
days=1, hours=4, seconds=30
12+
)
1113

1214

1315
# generate energy log timestamps with fixed hour timestamp used in tests

0 commit comments

Comments
 (0)