diff options
| author | thedoc <thedoc@atom.(none)> | 2009-12-07 22:38:20 +0100 |
|---|---|---|
| committer | thedoc <thedoc@atom.(none)> | 2009-12-07 22:38:20 +0100 |
| commit | 67858ed10ece500b2cf68dafb39886a0b873ec4c (patch) | |
| tree | 70ce402d1a310eaf5299aaba929c0c9ddde2d0f7 /lib/python/Plugins/SystemPlugins | |
| parent | 7950c2de2dbfd5bfee3650faaf45301187f7184a (diff) | |
| download | enigma2-67858ed10ece500b2cf68dafb39886a0b873ec4c.tar.gz enigma2-67858ed10ece500b2cf68dafb39886a0b873ec4c.zip | |
first working version of TempFanControl plugin with Sensors and FanControl component
Diffstat (limited to 'lib/python/Plugins/SystemPlugins')
4 files changed, 69 insertions, 1 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Makefile.am b/lib/python/Plugins/SystemPlugins/Makefile.am index a8b187dc..9cc538f3 100755 --- a/lib/python/Plugins/SystemPlugins/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/Makefile.am @@ -3,7 +3,8 @@ installdir = $(pkglibdir)/python/Plugins/SystemPlugins SUBDIRS = SoftwareManager FrontprocessorUpgrade PositionerSetup Satfinder \ SkinSelector SatelliteEquipmentControl Videomode VideoTune Hotplug \ DefaultServicesScanner NFIFlash DiseqcTester CommonInterfaceAssignment \ - CrashlogAutoSubmit CleanupWizard VideoEnhancement WirelessLan NetworkWizard + CrashlogAutoSubmit CleanupWizard VideoEnhancement WirelessLan NetworkWizard \ + TempFanControl install_PYTHON = \ __init__.py diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am b/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am new file mode 100644 index 00000000..78ff11c3 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am @@ -0,0 +1,5 @@ +installdir = $(LIBDIR)/enigma2/python/Plugins/SystemPlugins/TempFanControl + +install_PYTHON = \ + __init__.py \ + plugin.py diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/__init__.py b/lib/python/Plugins/SystemPlugins/TempFanControl/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/__init__.py diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py b/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py new file mode 100644 index 00000000..60af03cb --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py @@ -0,0 +1,62 @@ +from Components.ActionMap import ActionMap +from Components.Sensors import sensors +from Components.Sources.Sensor import SensorSource +from Components.ConfigList import ConfigListScreen +from Components.config import getConfigListEntry + +from Screens.Screen import Screen + +from Plugins.Plugin import PluginDescriptor +from Components.FanControl import fancontrol + +class TempFanControl(Screen, ConfigListScreen): + skin = """ + <screen position="100,100" size="550,400" title="Fan Control" > + <!--widget name="text" position="0,0" size="550,400" font="Regular;15" /--> + <widget source="SensorTemp" render="Label" position="380,300" zPosition="1" size="150,20" font="Regular;19" halign="right"> + <convert type="SensorToText"></convert> + </widget> + <widget source="SensorFan" render="Label" position="380,325" zPosition="1" size="150,20" font="Regular;19" halign="right"> + <convert type="SensorToText"></convert> + </widget> + <widget name="config" position="10,10" size="500,225" scrollbarMode="showOnDemand" /> + </screen>""" + + def __init__(self, session, args = None): + Screen.__init__(self, session) + + id = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)[0] + self["SensorTemp"] = SensorSource(sensorid = id) + id = sensors.getSensorsList(sensors.TYPE_FAN_RPM)[0] + self["SensorFan"] = SensorSource(sensorid = id, update_interval = 100) + + self.list = [] + if fancontrol.getFanCount() > 0: + self.list.append(getConfigListEntry(_("Fan Voltage"), fancontrol.getConfig(0).vlt)) + self.list.append(getConfigListEntry(_("Fan PWM"), fancontrol.getConfig(0).pwm)) + ConfigListScreen.__init__(self, self.list, session = self.session) + #self["config"].list = self.list + #self["config"].setList(self.list) + + self["actions"] = ActionMap(["OkCancelActions"], + { + "ok": self.save, + "cancel": self.revert + }, -1) + + def save(self): + fancontrol.getConfig(0).vlt.save() + fancontrol.getConfig(0).pwm.save() + self.close() + + def revert(self): + fancontrol.getConfig(0).vlt.load() + fancontrol.getConfig(0).pwm.load() + self.close() + +def main(session, **kwargs): + session.open(TempFanControl) + +def Plugins(**kwargs): + return PluginDescriptor(name = "Temperature and Fan control", description = _("Temperature and Fan control"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = main) +
\ No newline at end of file |
