Skip to content

Commit 67af136

Browse files
committed
ruff format
1 parent cd6340e commit 67af136

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,7 @@ async def _motion_state_update(
433433
async def _run_awake_tasks(self) -> None:
434434
"""Execute all awake tasks."""
435435
await super()._run_awake_tasks()
436-
if (
437-
self._scan_config_task_scheduled
438-
and await self._configure_scan_task()
439-
):
436+
if self._scan_config_task_scheduled and await self._configure_scan_task():
440437
self._scan_config_task_scheduled = False
441438

442439
async def _configure_scan_task(self) -> bool:

plugwise_usb/nodes/sed.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22

33
from __future__ import annotations
44

5-
from asyncio import (
6-
CancelledError,
7-
Future,
8-
Task,
9-
gather,
10-
get_running_loop,
11-
wait_for,
12-
)
5+
from asyncio import CancelledError, Future, Task, gather, get_running_loop, wait_for
136
from collections.abc import Awaitable, Callable, Coroutine
147
from dataclasses import replace
158
from datetime import datetime, timedelta
169
import logging
1710
from typing import Any, Final
1811

19-
from ..api import BatteryConfig, NodeEvent, NodeFeature, NodeInfo, NodeType
12+
from ..api import BatteryConfig, NodeEvent, NodeFeature, NodeType
2013
from ..connection import StickController
2114
from ..constants import MAX_UINT_2, MAX_UINT_4
2215
from ..exceptions import MessageError, NodeError
@@ -25,7 +18,6 @@
2518
NODE_AWAKE_RESPONSE_ID,
2619
NodeAwakeResponse,
2720
NodeAwakeResponseType,
28-
NodeInfoResponse,
2921
NodeResponseType,
3022
PlugwiseResponse,
3123
)
@@ -100,7 +92,7 @@ def __init__(
10092
self._battery_config = BatteryConfig()
10193
self._new_battery_config = BatteryConfig()
10294
self._sed_config_task_scheduled = False
103-
self._sed_node_info_update_task_scheduled = False
95+
self._sed_node_info_update_task_scheduled = False
10496

10597
self._last_awake: dict[NodeAwakeResponseType, datetime] = {}
10698
self._last_awake_reason: str = "Unknown"
@@ -618,15 +610,12 @@ async def _awake_timer(self) -> None:
618610
async def _run_awake_tasks(self) -> None:
619611
"""Execute all awake tasks."""
620612
if (
621-
self._sed_node_info_update_task_scheduled
622-
and await self.node_info_update(None) is not None
613+
self._sed_node_info_update_task_scheduled
614+
and await self.node_info_update(None) is not None
623615
):
624616
self._sed_node_info_update_task_scheduled = False
625617

626-
if (
627-
self._sed_config_task_scheduled
628-
and await self._configure_sed_task()
629-
):
618+
if self._sed_config_task_scheduled and await self._configure_sed_task():
630619
self._sed_config_task_scheduled = False
631620

632621
async def sed_configure( # pylint: disable=too-many-arguments

0 commit comments

Comments
 (0)