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
def getNextPowerManagerTimeOld(self): now = time() for timer in self.timer_list: if timer.timerType != TIMERTYPE.AUTOSTANDBY and timer.timerType != TIMERTYPE.AUTODEEPSTANDBY: next_act = timer.getNextWakeup() if next_act < now: continue return next_act return -1