diff options
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Converter/SensorToText.py | 2 | ||||
| -rw-r--r-- | lib/python/Components/FanControl.py | 4 | ||||
| -rw-r--r-- | lib/python/Components/Sensors.py | 2 | ||||
| -rw-r--r-- | lib/python/Components/Sources/Sensor.py | 16 |
4 files changed, 15 insertions, 9 deletions
diff --git a/lib/python/Components/Converter/SensorToText.py b/lib/python/Components/Converter/SensorToText.py index ab87ee2e..fb156faf 100644 --- a/lib/python/Components/Converter/SensorToText.py +++ b/lib/python/Components/Converter/SensorToText.py @@ -5,6 +5,8 @@ class SensorToText(Converter, object): Converter.__init__(self, arguments) def getText(self): + if self.source.getValue() is None: + return "" return "%d %s" % (self.source.getValue(), self.source.getUnit()) text = property(getText) diff --git a/lib/python/Components/FanControl.py b/lib/python/Components/FanControl.py index d7986c25..7a402272 100644 --- a/lib/python/Components/FanControl.py +++ b/lib/python/Components/FanControl.py @@ -23,8 +23,8 @@ class FanControl: default_vlt = self.getVoltage(fanid) default_pwm = self.getPWM(fanid) fan = ConfigSubsection() - fan.vlt = ConfigSlider(default = default_vlt, increment = 10, limits = (0, 255)) - fan.pwm = ConfigSlider(default = default_vlt, increment = 10, limits = (0, 255)) + fan.vlt = ConfigSlider(default = 16, increment = 5, limits = (0, 255)) + fan.pwm = ConfigSlider(default = 0, increment = 5, limits = (0, 255)) fan.vlt.addNotifier(boundFunction(setVlt, self, fanid)) fan.pwm.addNotifier(boundFunction(setPWM, self, fanid)) config.fans.append(fan) diff --git a/lib/python/Components/Sensors.py b/lib/python/Components/Sensors.py index 7f63455b..8898a030 100644 --- a/lib/python/Components/Sensors.py +++ b/lib/python/Components/Sensors.py @@ -67,6 +67,6 @@ class Sensors: self.sensors_list.append((self.TYPE_TEMPERATURE, name, unit, "/proc/stb/sensors/%s" % dirname)) for fanid in range(fancontrol.getFanCount()): if fancontrol.hasRPMSensor(fanid): - self.sensors_list.append((self.TYPE_FAN_RPM, _("fan"), "rpm", fanid)) + self.sensors_list.append((self.TYPE_FAN_RPM, _("Fan %d") % (fanid + 1), "rpm", fanid)) sensors = Sensors()
\ No newline at end of file diff --git a/lib/python/Components/Sources/Sensor.py b/lib/python/Components/Sources/Sensor.py index 3f6c8f0f..e927bbf4 100644 --- a/lib/python/Components/Sources/Sensor.py +++ b/lib/python/Components/Sources/Sensor.py @@ -5,17 +5,20 @@ from enigma import eTimer from Source import Source class SensorSource(Source): - def __init__(self, update_interval = 500, sensorid = 0): + def __init__(self, update_interval = 500, sensorid = None): self.update_interval = update_interval self.sensorid = sensorid Source.__init__(self) - self.update_timer = eTimer() - self.update_timer.callback.append(self.updateValue) - self.update_timer.start(self.update_interval) + if sensorid is not None: + self.update_timer = eTimer() + self.update_timer.callback.append(self.updateValue) + self.update_timer.start(self.update_interval) def getValue(self): - return sensors.getSensorValue(self.sensorid) + if self.sensorid is not None: + return sensors.getSensorValue(self.sensorid) + return None def getUnit(self): return sensors.getSensorUnit(self.sensorid) @@ -24,4 +27,5 @@ class SensorSource(Source): self.changed((self.CHANGED_POLL,)) def destroy(self): - self.update_timer.callback.remove(self.updateValue) + if self.sensorid is not None: + self.update_timer.callback.remove(self.updateValue) |
