mirror of
https://github.com/slgobinath/SafeEyes.git
synced 2024-12-27 00:02:36 +01:00
Fix idle start time calculation
This commit is contained in:
parent
2736321048
commit
ebe6f1aafb
@ -151,7 +151,7 @@ def __start_idle_monitor():
|
|||||||
system_idle_time = __system_idle_time()
|
system_idle_time = __system_idle_time()
|
||||||
if system_idle_time >= idle_time and context['state'] == State.WAITING:
|
if system_idle_time >= idle_time and context['state'] == State.WAITING:
|
||||||
smart_pause_activated = True
|
smart_pause_activated = True
|
||||||
idle_start_time = datetime.datetime.now()
|
idle_start_time = datetime.datetime.now() - datetime.timedelta(seconds=system_idle_time)
|
||||||
logging.info('Pause Safe Eyes due to system idle')
|
logging.info('Pause Safe Eyes due to system idle')
|
||||||
disable_safe_eyes(None)
|
disable_safe_eyes(None)
|
||||||
elif system_idle_time < idle_time and context['state'] == State.STOPPED and idle_start_time is not None:
|
elif system_idle_time < idle_time and context['state'] == State.STOPPED and idle_start_time is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user