Add a verification onwake

Somehow, Kodi can trigger OnWake without first trigger OnSleep.
This commit is contained in:
angelblue05 2018-10-15 21:14:21 -05:00
parent f8bf3b5151
commit 98f4f11fc2

View file

@ -380,6 +380,11 @@ class Service(xbmc.Monitor):
elif method == 'System.OnWake': elif method == 'System.OnWake':
if not self.monitor.sleep:
LOG.warn("System.OnSleep was never called, skip System.OnWake")
return
LOG.info("--<[ sleep ]") LOG.info("--<[ sleep ]")
xbmc.sleep(10000)# Allow network to wake up xbmc.sleep(10000)# Allow network to wake up
self.monitor.sleep = False self.monitor.sleep = False