Diff of /script.advanced.wol/autostart.py [d416f2] .. [4c653c]  Maximize  Restore

Switch to side-by-side view

--- a/script.advanced.wol/autostart.py
+++ b/script.advanced.wol/autostart.py
@@ -1,13 +1,30 @@
 # Wake-On-LAN
 
-import xbmcaddon, sys
-
-settings = xbmcaddon.Addon( id="script.advanced.wol" )
+import xbmcaddon, sys, time
 
 # Read Settings
 settings = xbmcaddon.Addon( id="script.advanced.wol" )
 autostart = settings.getSetting("autostart")
+wolAfterStandby = settings.getSetting("wolAfterStandby")
+wolDelayOnLaunch = int(settings.getSetting("wolDelayOnLaunch"))
+wolDelayAfterStandby = int(settings.getSetting("wolDelayAfterStandby"))
 
 if (autostart == "true"):
   import default
-  default.main()+  if (wolDelayOnLaunch > 0):
+	xbmc.sleep(wolDelayOnLaunch*1000)
+  default.main(True)
+  if (wolAfterStandby == "true"):
+	print "script.advanced.wol: Waiting for resume from standby"
+	previousTime = time.time()
+	while (not xbmc.abortRequested):
+		if ( time.time()-previousTime > 5):
+			if (wolDelayAfterStandby > 0):
+				xbmc.sleep(wolDelayAfterStandby*1000)
+			print "script.advanced.wol: Start WOL script after return from standby"
+			default.main(True)
+			previousTime = time.time()
+			xbmc.sleep(1000)
+		else:
+			previousTime = time.time()
+			xbmc.sleep(1000)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks