Skip to content

Commit 206efee

Browse files
committed
ruff PLR0911 Too many return statements. Won't fix as it seems the number of returns are valid.
ruff PLR0912 Too many branches ({branches} > {max_branches}). Won't fix code seems correct. ruff PLR0913 Too many arguments to function call ({c_args} > {max_args}). Won't fix code seems correct.
1 parent da6d244 commit 206efee

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

plugwise_usb/messages/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ class NodeSleepConfigRequest(PlugwiseRequest):
12011201
_identifier = b"0050"
12021202

12031203
# pylint: disable=too-many-arguments
1204-
def __init__(
1204+
def __init__( # noqa: PLR0913
12051205
self,
12061206
send_fn: Callable[[PlugwiseRequest, bool], Awaitable[PlugwiseResponse | None]],
12071207
mac: bytes,

plugwise_usb/messages/responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ def __init__(self) -> None:
950950
self._params += [self.is_get, self.relay]
951951

952952

953-
def get_message_object( # noqa: C901
953+
def get_message_object( # noqa: C901 PLR0911 PLR0912
954954
identifier: bytes, length: int, seq_id: bytes
955955
) -> PlugwiseResponse | None:
956956
"""Return message class based on sequence ID, Length of message or message ID."""

plugwise_usb/network/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def update_network_registration(
179179
if self._network_cache is not None:
180180
self._network_cache.update_registration(address, mac, node_type)
181181

182-
async def update_missing_registrations(self, quick: bool = False) -> None:
182+
async def update_missing_registrations(self, quick: bool = False) -> None: # noqa: PLR0912
183183
"""Retrieve all unknown network registrations from network controller."""
184184
for address in range(0, 64):
185185
if self._registry.get(address) is not None and not quick:

plugwise_usb/nodes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .switch import PlugwiseSwitch
1515

1616

17-
def get_plugwise_node(
17+
def get_plugwise_node( # noqa: PLR0911
1818
mac: str,
1919
address: int,
2020
controller: StickController,

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def _log_no_energy_stats_update(self) -> None:
329329

330330
@raise_not_loaded
331331
@raise_calibration_missing
332-
async def energy_update(self) -> EnergyStatistics | None:
332+
async def energy_update(self) -> EnergyStatistics | None: # noqa: PLR0911 PLR0912
333333
"""Return updated energy usage statistics."""
334334
if self._current_log_address is None:
335335
_LOGGER.debug(
@@ -999,7 +999,7 @@ async def _node_info_load_from_cache(self) -> bool:
999999
return False
10001000

10011001
# pylint: disable=too-many-arguments
1002-
async def update_node_details(
1002+
async def update_node_details( # noqa: PLR0913
10031003
self,
10041004
firmware: datetime | None,
10051005
hardware: str | None,

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def _update_last_consumption_log_reference(
682682
self._last_log_consumption_address = address
683683
self._last_log_consumption_slot = slot
684684

685-
def _reset_log_references(self) -> None:
685+
def _reset_log_references(self) -> None: # noqa: PLR0912
686686
"""Reset log references."""
687687
self._last_log_consumption_address = None
688688
self._last_log_consumption_slot = None
@@ -824,7 +824,7 @@ def _first_log_reference(
824824
)
825825
return (self._first_log_production_address, self._first_log_production_slot)
826826

827-
def _logs_missing(self, from_timestamp: datetime) -> list[int] | None:
827+
def _logs_missing(self, from_timestamp: datetime) -> list[int] | None: # noqa: PLR0911 PLR0912
828828
"""Calculate list of missing log addresses."""
829829
if self._logs is None:
830830
self._log_addresses_missing = None

plugwise_usb/nodes/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ async def _node_info_load_from_cache(self) -> bool:
489489
)
490490

491491
# pylint: disable=too-many-arguments
492-
async def update_node_details(
492+
async def update_node_details( # noqa: PLR0912 PLR0913
493493
self,
494494
firmware: datetime | None,
495495
hardware: str | None,

0 commit comments

Comments
 (0)