aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RecordTimer.py26
-rw-r--r--lib/python/Screens/Standby.py7
-rw-r--r--mytest.py18
3 files changed, 39 insertions, 12 deletions
diff --git a/RecordTimer.py b/RecordTimer.py
index 1e21091d..b18a594d 100644
--- a/RecordTimer.py
+++ b/RecordTimer.py
@@ -236,8 +236,15 @@ class RecordTimerEntry(timer.TimerEntry):
return True
if self.justplay:
- self.log(11, "zapping")
- NavigationInstance.instance.playService(self.service_ref.ref)
+ if Screens.Standby.inStandby:
+ self.log(11, "wakeup and zap")
+ #set service to zap after standby
+ Screens.Standby.inStandby.prev_running_service = self.service_ref.ref
+ #wakeup standby
+ Screens.Standby.inStandby.Power()
+ else:
+ self.log(11, "zapping")
+ NavigationInstance.instance.playService(self.service_ref.ref)
return True
else:
self.log(11, "start recording")
@@ -437,12 +444,25 @@ class RecordTimer(timer.Timer):
file.write(x)
file.close()
+ def getNextZapTime(self):
+ llen = len(self.timer_list)
+ idx = 0
+ now = time.time()
+ while idx < llen:
+ timer = self.timer_list[idx]
+ if not timer.justplay or timer.begin < now:
+ idx += 1
+ else:
+ return timer.begin
+ return -1
+
def getNextRecordingTime(self):
llen = len(self.timer_list)
idx = 0
+ now = time.time()
while idx < llen:
timer = self.timer_list[idx]
- if timer.justplay:
+ if timer.justplay or timer.begin < now:
idx += 1
else:
return timer.begin
diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py
index 88367cf7..a7819268 100644
--- a/lib/python/Screens/Standby.py
+++ b/lib/python/Screens/Standby.py
@@ -5,7 +5,7 @@ from Components.AVSwitch import AVSwitch
from enigma import eDVBVolumecontrol, eDBoxLCD, eServiceReference
from Components.Sources.Clock import Clock
-inStandby = False
+inStandby = None
class Standby(Screen):
def Power(self):
@@ -63,12 +63,11 @@ class Standby(Screen):
def __onShow(self):
global inStandby
- inStandby = True
+ inStandby = self
def __onHide(self):
global inStandby
- inStandby = False
-
+ inStandby = None
class StandbySummary(Screen):
skin = """
diff --git a/mytest.py b/mytest.py
index 58c5c680..e674a295 100644
--- a/mytest.py
+++ b/mytest.py
@@ -493,13 +493,21 @@ def runScreenTest():
from time import time
from Tools.DreamboxHardware import setFPWakeuptime
+ #get next record timer start time
nextRecordingTime = session.nav.RecordTimer.getNextRecordingTime()
- if nextRecordingTime != -1:
- if (nextRecordingTime - time() < 330): # no time to switch box back on
- setFPWakeuptime(time() + 30) # so switch back on in 30 seconds
+ #get next zap timer start time
+ nextZapTime = session.nav.RecordTimer.getNextZapTime()
+ #get currentTime
+ nowTime = time()
+ if nextZapTime != -1 and nextRecordingTime != -1:
+ startTime = nextZapTime < nextRecordingTime and nextZapTime or nextRecordingTime
+ else:
+ startTime = nextZapTime != -1 and nextZapTime or nextRecordingTime
+ if startTime != -1:
+ if (startTime - nowTime < 330): # no time to switch box back on
+ setFPWakeuptime(nowTime + 30) # so switch back on in 30 seconds
else:
- setFPWakeuptime(nextRecordingTime - (300))
-
+ setFPWakeuptime(startTime - 300)
session.nav.stopService()
session.nav.shutdown()