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")
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
from enigma import eDVBVolumecontrol, eDBoxLCD, eServiceReference
from Components.Sources.Clock import Clock
-inStandby = False
+inStandby = None
class Standby(Screen):
def Power(self):
def __onShow(self):
global inStandby
- inStandby = True
+ inStandby = self
def __onHide(self):
global inStandby
- inStandby = False
-
+ inStandby = None
class StandbySummary(Screen):
skin = """
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()