def getNextPowerManagerTimeOld(self, getNextStbPowerOn = False):
now = int(time())
nextPTlist = [(-1,None,None,None)]
for timer in self.timer_list:
if timer.timerType != TIMERTYPE.AUTOSTANDBY and timer.timerType != TIMERTYPE.AUTODEEPSTANDBY:
next_act = timer.getNextWakeup(getNextStbPowerOn)
if next_act + 3 < now:
continue
if getNextStbPowerOn and debug:
print "[powertimer] next stb power up", strftime("%a, %Y/%m/%d %H:%M", localtime(next_act))
next_timertype = next_afterevent = None
if nextPTlist[0][0] == -1:
if abs(next_act - timer.begin) <= 30:
next_timertype = timer.timerType
elif abs(next_act - timer.end) <= 30:
next_afterevent = timer.afterEvent
nextPTlist = [(next_act,next_timertype,next_afterevent,timer.state)]
else:
if abs(next_act - timer.begin) <= 30:
next_timertype = timer.timerType
elif abs(next_act - timer.end) <= 30:
next_afterevent = timer.afterEvent
nextPTlist.append((next_act,next_timertype,next_afterevent,timer.state))
nextPTlist.sort()
return nextPTlist
评论列表
文章目录