Skip to content

Commit e8059db

Browse files
committed
Move task-bool just before setting tasks
1 parent ec581c0 commit e8059db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ async def set_motion_daylight_mode(self, state: bool) -> bool:
309309
self._new_motion_config, daylight_mode=state
310310
)
311311
if not self._scan_config_task_scheduled:
312-
await self.schedule_task_when_awake(await self._configure_scan_task())
313312
self._scan_config_task_scheduled = True
313+
await self.schedule_task_when_awake(await self._configure_scan_task())
314314
_LOGGER.debug(
315315
"set_motion_daylight_mode | Device %s | config scheduled",
316316
self.name,
@@ -337,12 +337,12 @@ async def set_motion_reset_timer(self, minutes: int) -> bool:
337337
self._new_motion_config, reset_timer=minutes
338338
)
339339
if not self._scan_config_task_scheduled:
340-
await self.schedule_task_when_awake(await self._configure_scan_task())
341-
self._scan_config_task_scheduled = True
342340
_LOGGER.debug(
343-
"set_motion_reset_timer | Device %s | config scheduled",
341+
"set_motion_reset_timer | Device %s | schedule config",
344342
self.name,
345343
)
344+
self._scan_config_task_scheduled = True
345+
await self.schedule_task_when_awake(await self._configure_scan_task())
346346
return True
347347

348348
@raise_not_loaded
@@ -361,8 +361,8 @@ async def set_motion_sensitivity_level(self, level: MotionSensitivity) -> bool:
361361
self._new_motion_config, sensitivity_level=level
362362
)
363363
if not self._scan_config_task_scheduled:
364-
await self.schedule_task_when_awake(await self._configure_scan_task())
365364
self._scan_config_task_scheduled = True
365+
await self.schedule_task_when_awake(await self._configure_scan_task())
366366
_LOGGER.debug(
367367
"set_motion_sensitivity_level | Device %s | config scheduled",
368368
self.name,

0 commit comments

Comments
 (0)