Skip to content

Commit 82dc77e

Browse files
committed
Don't try resetting node_types that don't support it
1 parent 95dc620 commit 82dc77e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugwise_usb/network/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,11 @@ 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 {self._nodes[mac].node_info.node_type.name}"
550+
)
551+
547552
node_protocols = self._nodes[mac].node_protocols
548553
request = CircleClockSetRequest(
549554
self._controller.send,

0 commit comments

Comments
 (0)