PowerTimer.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:enigma2 作者: OpenLD 项目源码 文件源码
def __init__(self, begin, end, disabled = False, afterEvent = AFTEREVENT.NONE, timerType = TIMERTYPE.WAKEUP, checkOldTimers = False, autosleepdelay = 60):
        timer.TimerEntry.__init__(self, int(begin), int(end))
        if checkOldTimers:
            if self.begin < time() - 1209600:
                self.begin = int(time())

        if self.end < self.begin:
            self.end = self.begin

        self.dontSave = False
        self.disabled = disabled
        self.timer = None
        self.__record_service = None
        self.start_prepare = 0
        self.timerType = timerType
        self.afterEvent = afterEvent
        self.autoincrease = False
        self.autoincreasetime = 3600 * 24 # 1 day
        self.autosleepinstandbyonly = 'no'
        self.autosleepdelay = autosleepdelay
        self.autosleeprepeat = 'once'
        self.autosleepwindow = 'no'
        self.autosleepbegin = self.begin
        self.autosleepend = self.end

        self.nettraffic = 'no'
        self.trafficlimit = 100
        self.netip = 'no'
        self.ipadress = "0.0.0.0"

        self.log_entries = []
        self.resetState()

        self.messageBoxAnswerPending = False

        #check autopowertimer
        if (self.timerType == TIMERTYPE.AUTOSTANDBY or self.timerType == TIMERTYPE.AUTODEEPSTANDBY) and not self.disabled and time() > 3600 and self.begin > time():
            self.begin = int(time())                        #the begin is in the future -> set to current time = no start delay of this timer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号