Skip to content

Commit 6e9ce33

Browse files
author
autoruff
committed
fixup: clear-cache Python code reformatted using Ruff
1 parent 1e72e61 commit 6e9ce33

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,10 @@ async def energy_reset_request(self) -> None:
13071307
if (interval_response := await interval_request.send()) is None:
13081308
raise NodeError("No response for CircleMeasureIntervalRequest")
13091309

1310-
if interval_response.response_type != NodeResponseType.POWER_LOG_INTERVAL_ACCEPTED:
1310+
if (
1311+
interval_response.response_type
1312+
!= NodeResponseType.POWER_LOG_INTERVAL_ACCEPTED
1313+
):
13111314
raise MessageError(
13121315
f"Unknown NodeResponseType '{interval_response.response_type.name}' received"
13131316
)

plugwise_usb/nodes/helpers/counter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def add_pulse_stats(
104104
self.update()
105105

106106
def reset_pulse_collection(self) -> None:
107-
""" Reset the related pulse collection."""
107+
"""Reset the related pulse collection."""
108108
self._pulse_collection.reset()
109109

110110
@property

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def _check_prev_production(
533533
"""Check the previous slot for production pulses."""
534534
if self._logs is None:
535535
return
536-
536+
537537
prev_address, prev_slot = calc_log_address(address, slot, -1)
538538
if self._log_exists(prev_address, prev_slot):
539539
prev_timestamp = self._logs[prev_address][prev_slot].timestamp
@@ -897,11 +897,12 @@ def _logs_missing(self, from_timestamp: datetime) -> list[int] | None: # noqa:
897897
count = 0
898898
max_count = MAX_LOG_HOURS
899899
if self._log_production:
900-
max_count = 2 * max_count # this requires production_interval == consumption_interval
900+
max_count = (
901+
2 * max_count
902+
) # this requires production_interval == consumption_interval
901903

902904
while not (
903-
(address == first_address and slot == first_slot)
904-
or count > max_count
905+
(address == first_address and slot == first_slot) or count > max_count
905906
):
906907
address, slot = calc_log_address(address, slot, -1)
907908
if address in missing:

0 commit comments

Comments
 (0)