Skip to content

Commit d1a5c3a

Browse files
committed
Improve
1 parent 0848e5a commit d1a5c3a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

plugwise_usb/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ async def energy_reset_request(self, mac: str) -> bool:
218218
raise NodeError(f"{exc}") from exc
219219

220220
# Follow up by an energy-intervals (re)set
221-
result = await self.set_energy_intervals(mac, 60, 0)
222-
if result:
221+
if (result := await self.set_energy_intervals(mac, 60, 0)):
223222
return True
224223

225224
return False

plugwise_usb/network/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
from asyncio import Task, create_task, gather, sleep
88
from collections.abc import Callable, Coroutine
9-
from datetime import datetime, timedelta
9+
from datetime import UTC, datetime, timedelta
1010
import logging
1111
from typing import Any
1212

1313
from ..api import NodeEvent, NodeType, PlugwiseNode, StickEvent
1414
from ..connection import StickController
15-
from ..constants import UTC, UTF8
15+
from ..constants import UTF8
1616
from ..exceptions import CacheError, MessageError, NodeError, StickError, StickTimeout
1717
from ..messages.requests import (
1818
CircleClockSetRequest,
@@ -545,7 +545,7 @@ async def allow_join_requests(self, state: bool) -> None:
545545
async def energy_reset_request(self, mac: str) -> None:
546546
"""Send an energy-reset to a Node."""
547547
request = CircleClockSetRequest(
548-
self._send,
548+
self._controller.send,
549549
self._mac_in_bytes,
550550
datetime.now(tz=UTC),
551551
self._node_protocols.max,

0 commit comments

Comments
 (0)