Skip to content

Commit 1e09f9a

Browse files
committed
Sed: add set_awake_duration equal-check
1 parent 861ad0d commit 1e09f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/nodes/sed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ async def set_awake_duration(self, seconds: int) -> bool:
247247
raise ValueError(
248248
f"Invalid awake duration ({seconds}). It must be between 1 and 255 seconds."
249249
)
250+
if self.battery_config.awake_duration == seconds:
251+
return False
250252

251253
self._new_battery_config = replace(
252254
self._new_battery_config, awake_duration=seconds
@@ -274,7 +276,6 @@ async def set_clock_interval(self, minutes: int) -> bool:
274276
raise ValueError(
275277
f"Invalid clock interval ({minutes}). It must be between 1 and 65535 minutes."
276278
)
277-
278279
if self.battery_config.clock_interval == minutes:
279280
return False
280281

@@ -327,7 +328,6 @@ async def set_maintenance_interval(self, minutes: int) -> bool:
327328
raise ValueError(
328329
f"Invalid maintenance interval ({minutes}). It must be between 1 and 1440 minutes."
329330
)
330-
331331
if self.battery_config.maintenance_interval == minutes:
332332
return False
333333

0 commit comments

Comments
 (0)