Skip to content

Commit ba96e72

Browse files
committed
Don't try resetting node_types that don't support it
1 parent a8cdf35 commit ba96e72

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugwise_usb/network/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +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+
if self._nodes[mac].node_info.node_type.value not in (1, 2, 9):
548+
raise NodeError(
549+
"Energy-resetting not supported for %s",
550+
self._nodes[mac].node_info.node_type.name
551+
)
552+
547553
node_protocols = self._nodes[mac].node_protocols
548554
request = CircleClockSetRequest(
549555
self._controller.send,

0 commit comments

Comments
 (0)