Skip to content

Commit 95dc620

Browse files
committed
Fixes
1 parent d1a5c3a commit 95dc620

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

plugwise_usb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def energy_reset_request(self, mac: str) -> bool:
219219

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

224224
return False
225225

plugwise_usb/network/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,12 @@ async def allow_join_requests(self, state: bool) -> None:
544544

545545
async def energy_reset_request(self, mac: str) -> None:
546546
"""Send an energy-reset to a Node."""
547+
node_protocols = self._nodes[mac].node_protocols
547548
request = CircleClockSetRequest(
548549
self._controller.send,
549-
self._mac_in_bytes,
550+
bytes(mac, UTF8),
550551
datetime.now(tz=UTC),
551-
self._node_protocols.max,
552+
node_protocols.max,
552553
True,
553554
)
554555
if (response := await request.send()) is None:

plugwise_usb/nodes/node.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ def available_state(self) -> AvailableState:
100100
self._last_seen,
101101
)
102102

103+
@property
104+
def node_protocols(self) -> SupportedVersions | None:
105+
"""Return the node_protocols for the Node."""
106+
if self._node_protocols is None:
107+
return None
108+
109+
return self._node_protocols
110+
103111
@property
104112
@raise_not_loaded
105113
def battery_config(self) -> BatteryConfig:

0 commit comments

Comments
 (0)