--- PowerTimer.py.orig.3.2_021 +++ PowerTimer.py @@ -145,6 +145,27 @@ return True elif self.timerType == TIMERTYPE.AUTOSTANDBY: +# GML - we shouldn't go into Auto Standby whilst watching a recording!! +# (key pressing is handled by keyPressed, you might not press a +# key for > the autosleep polling time). +# Backoff code copied from AUTODEEPSTANDBY section +# ??? +# ??? Why are there no "return False" statements after the +# ??? 3 self.end = self.begin assigments below, and the one at +# ??? the start of this function? (Python default is to return None). +# ??? +# + from Screens.InfoBar import MoviePlayer + print "GML: checking for backing off auto-sleep timer.." + if MoviePlayer.instance is not None and '0:0:0:0:0:0:0:0:0' in NavigationInstance.instance.currentlyPlayingServiceReference.toString(): + print "GML: actually backing off auto-sleep timer.." + self.do_backoff() + # retry + self.begin = time() + self.backoff + if self.end <= self.begin: + self.end = self.begin + return False +# GML - end if not Screens.Standby.inStandby: # not already in standby Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A finished powertimer wants to set your\n%s %s to standby. Do that now?") % (getMachineBrand(), getMachineName()), timeout = 180) if self.autosleeprepeat == "once": @@ -159,6 +180,14 @@ if self.end <= self.begin: self.end = self.begin +# GML: This should also be checking for someone using the streaming +# service on port 8001, but I can't find any way to check for that. +# Other checks could be +# a) someone logged in on the command line +# b) FTP/scp in use? +# Perhaps running an external script (/etc/enigma2/deep_standy_check.sh?) +# if it exists and only activating on a zero return status. +# elif self.timerType == TIMERTYPE.AUTODEEPSTANDBY: if (NavigationInstance.instance.RecordTimer.isRecording() or abs(NavigationInstance.instance.RecordTimer.getNextRecordingTime() - time()) <= 900 or abs(NavigationInstance.instance.RecordTimer.getNextZapTime() - time()) <= 900) or (self.autosleepinstandbyonly == 'yes' and not Screens.Standby.inStandby) or (self.autosleepinstandbyonly == 'yes' and Screens.Standby.inStandby and internalHDDNotSleeping()): self.do_backoff()