Skip to content

Commit 1696031

Browse files
committed
return type change to indicate already or newly activated
scan_light_calibration
1 parent 1d56d5f commit 1696031

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,16 @@ async def _scan_configure_update(self) -> None:
490490
self.save_cache(),
491491
)
492492

493-
async def scan_calibrate_light(self) -> None:
494-
"""Schedule light sensitivity calibration of Scan device."""
493+
async def scan_calibrate_light(self) -> bool:
494+
"""Schedule light sensitivity calibration of Scan device.
495+
496+
Returns True when scheduling was newly activated;
497+
False if it was already scheduled.
498+
"""
499+
if self._scan_calibrate_light_scheduled:
500+
return False
495501
self._scan_calibrate_light_scheduled = True
502+
return True
496503

497504
async def _scan_calibrate_light(self) -> bool:
498505
"""Request to calibration light sensitivity of Scan device."""

0 commit comments

Comments
 (0)