|
2 | 2 |
|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
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 |
13 | 6 | from collections.abc import Awaitable, Callable, Coroutine |
14 | 7 | from dataclasses import replace |
15 | 8 | from datetime import datetime, timedelta |
16 | 9 | import logging |
17 | 10 | from typing import Any, Final |
18 | 11 |
|
19 | | -from ..api import BatteryConfig, NodeEvent, NodeFeature, NodeInfo, NodeType |
| 12 | +from ..api import BatteryConfig, NodeEvent, NodeFeature, NodeType |
20 | 13 | from ..connection import StickController |
21 | 14 | from ..constants import MAX_UINT_2, MAX_UINT_4 |
22 | 15 | from ..exceptions import MessageError, NodeError |
|
25 | 18 | NODE_AWAKE_RESPONSE_ID, |
26 | 19 | NodeAwakeResponse, |
27 | 20 | NodeAwakeResponseType, |
28 | | - NodeInfoResponse, |
29 | 21 | NodeResponseType, |
30 | 22 | PlugwiseResponse, |
31 | 23 | ) |
@@ -100,7 +92,7 @@ def __init__( |
100 | 92 | self._battery_config = BatteryConfig() |
101 | 93 | self._new_battery_config = BatteryConfig() |
102 | 94 | self._sed_config_task_scheduled = False |
103 | | - self._sed_node_info_update_task_scheduled = False |
| 95 | + self._sed_node_info_update_task_scheduled = False |
104 | 96 |
|
105 | 97 | self._last_awake: dict[NodeAwakeResponseType, datetime] = {} |
106 | 98 | self._last_awake_reason: str = "Unknown" |
@@ -618,15 +610,12 @@ async def _awake_timer(self) -> None: |
618 | 610 | async def _run_awake_tasks(self) -> None: |
619 | 611 | """Execute all awake tasks.""" |
620 | 612 | 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 |
623 | 615 | ): |
624 | 616 | self._sed_node_info_update_task_scheduled = False |
625 | 617 |
|
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(): |
630 | 619 | self._sed_config_task_scheduled = False |
631 | 620 |
|
632 | 621 | async def sed_configure( # pylint: disable=too-many-arguments |
|
0 commit comments