1 from Components.config import config, ConfigSubList, ConfigSubsection
2 import NavigationInstance
3 from enigma import iRecordableService
4 from Components.ConfigList import ConfigListScreen
5 from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigSelection, ConfigInteger, ConfigSlider
7 config.plugins.simplefancontrols = ConfigSubsection()
8 config.plugins.simplefancontrols.standbymode = ConfigSelection(default = "on", choices = [
9 ("off", _("off")), ("on", _("on"))])
10 config.plugins.simplefancontrols.recordingmode = ConfigSelection(default = "on", choices = [
11 ("off", _("no")), ("on", _("yes"))])
12 config.plugins.simplefancontrols.pwmvalue = ConfigSlider(default = 100, increment = 5, limits = (5, 255))
16 config.misc.standbyCounter.addNotifier(self.standbyBegin, initial_call = False)
18 def standbyBegin(self, configElement):
19 print "<SimpleFancontrol> config.plugins.fancontrols.standbymode.value : ", config.plugins.simplefancontrols.standbymode.value
20 if config.plugins.simplefancontrols.standbymode.value == "on":
21 from Screens.Standby import inStandby
22 inStandby.onClose.append(self.StandbyEnd)
23 NavigationInstance.instance.record_event.append(self.getRecordEvent)
24 recordings = NavigationInstance.instance.getRecordings()
29 print "<SimpleFancontrol> Standby End"
30 NavigationInstance.instance.record_event.remove(self.getRecordEvent)
31 if self.getPWM() == 0:
32 self.setPWM(config.plugins.simplefancontrols.pwmvalue.value)
34 def getRecordEvent(self, recservice, event):
35 recordings = len(NavigationInstance.instance.getRecordings())
36 print "<SimpleFancontrol> recordings : %d , event : %d" % (recordings,event)
37 if event == iRecordableService.evEnd:
38 print "<SimpleFancontrol> getRecordEvent : evEnd"
41 elif event == iRecordableService.evStart:
42 print "<SimpleFancontrol> getRecordEvent : evStart"
43 if self.getPWM() == 0:
44 self.setPWM(config.plugins.simplefancontrols.pwmvalue.value)
47 f = open("/proc/stb/fp/fan_pwm", "r")
48 value = int(f.readline().strip(), 16)
50 print "<SimpleFancontrol> getPWM : %d "%value
53 def setPWM(self, value):
54 print "<SimpleFancontrol> setPWM to : %d"%value
55 f = open("/proc/stb/fp/fan_pwm", "w")
59 instandbyon = instandbyOn()