Skip to content

Commit b47b7b6

Browse files
committed
Block setting energy intervals on devices that don't support it
1 parent 38e629e commit b47b7b6

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
@@ -573,6 +573,11 @@ async def set_energy_intervals(
573573
Default: consumption = 60, production = 0.
574574
For logging energy in both directions set both to 60.
575575
"""
576+
if self._nodes[mac].node_info.node_type.value not in (1, 2, 9):
577+
raise NodeError(
578+
"Setting energy-intervals not supported for {self._nodes[mac].node_info.node_type.name}"
579+
)
580+
576581
# Validate input parameters
577582
if consumption <= 0:
578583
raise ValueError("Consumption interval must be positive")

0 commit comments

Comments
 (0)