def save(self): for count in range(fancontrol.getFanCount()): # fancontrol.getConfig(count).vlt.save() # [iq] fancontrol.getConfig(count).pwm.save() # fancontrol.getConfig(count).vlt_standby.save() # [iq] fancontrol.getConfig(count).pwm_standby.save() self.close()
def revert(self): for count in range(fancontrol.getFanCount()): # fancontrol.getConfig(count).vlt.load() # [iq] fancontrol.getConfig(count).pwm.load() # fancontrol.getConfig(count).vlt_standby.load() # [iq] fancontrol.getConfig(count).pwm_standby.load() self.close()
def __init__(self, session, args=None): Screen.__init__(self, session) templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE) tempcount = len(templist) fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM) fancount = len(fanlist) self["red"] = StaticText(_("Cancel")) self["green"] = StaticText(_("OK")) self["yellow"] = StaticText("") self["blue"] = StaticText("") for count in range(8): if count < tempcount: id = templist[count] self["SensorTempText%d" % count] = StaticText( sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid=id) else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() if count < fancount: id = fanlist[count] self["SensorFanText%d" % count] = StaticText( sensors.getSensorName(id)) self["SensorFan%d" % count] = SensorSource(sensorid=id) else: self["SensorFanText%d" % count] = StaticText("") self["SensorFan%d" % count] = SensorSource() self.list = [] for count in range(fancontrol.getFanCount()): self.list.append( getConfigListEntry( _("Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append( getConfigListEntry( _("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) self.list.append( getConfigListEntry( _("Standby Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) self.list.append( getConfigListEntry( _("Standby Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) ConfigListScreen.__init__(self, self.list, session=self.session) self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], { "ok": self.save, "cancel": self.revert, "red": self.revert, "green": self.save }, -1)
def save(self): for count in range(fancontrol.getFanCount()): fancontrol.getConfig(count).vlt.save() fancontrol.getConfig(count).pwm.save() fancontrol.getConfig(count).vlt_standby.save() fancontrol.getConfig(count).pwm_standby.save() self.close()
def revert(self): for count in range(fancontrol.getFanCount()): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() fancontrol.getConfig(count).vlt_standby.load() fancontrol.getConfig(count).pwm_standby.load() self.close()
def __init__(self, session, args = None): Screen.__init__(self, session) Screen.setTitle(self, _("Fan Control")) templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE) tempcount = len(templist) fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM) fancount = len(fanlist) stb = HardwareInfo().get_device_name() self["key_red"] = self["red"] = StaticText(_("Cancel")) self["key_green"] = self["green"] = StaticText(_("OK")) for count in range(8): if count < tempcount: id = templist[count] if stb not in ('optimussos1', 'optimussos2', 'solo2'): self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid = id) elif stb in ('optimussos1', 'optimussos2', 'solo2') and id < 1: self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid = id) else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() if count < fancount: id = fanlist[count] self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorFan%d" % count] = SensorSource(sensorid = id) else: self["SensorFanText%d" % count] = StaticText("") self["SensorFan%d" % count] = SensorSource() self.list = [] for count in range(fancontrol.getFanCount()): if stb not in ('optimussos1', 'optimussos2', 'solo2'): self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) if stb not in ('optimussos1', 'optimussos2', 'solo2'): self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) ConfigListScreen.__init__(self, self.list, session = self.session) #self["config"].list = self.list #self["config"].setList(self.list) self["config"].l.setSeperation(300) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"], { "ok": self.save, "cancel": self.revert, "red": self.revert, "green": self.save, "menu": self.closeRecursive, }, -1)
def __init__(self, session, args = None): Screen.__init__(self, session) Screen.setTitle(self, _("Fan Control")) templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE) tempcount = len(templist) fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM) fancount = len(fanlist) self["key_red"] = self["red"] = StaticText(_("Cancel")) self["key_green"] = self["green"] = StaticText(_("OK")) for count in range(8): if count < tempcount: id = templist[count] if getBrandOEM() not in ('dags', 'vuplus'): self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid = id) elif getBrandOEM() in ('dags', 'vuplus') and id < 1: self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid = id) else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() if count < fancount: id = fanlist[count] self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorFan%d" % count] = SensorSource(sensorid = id) else: self["SensorFanText%d" % count] = StaticText("") self["SensorFan%d" % count] = SensorSource() self.list = [] for count in range(fancontrol.getFanCount()): if getBrandOEM() not in ('dags', 'vuplus'): self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) if getBrandOEM() not in ('dags', 'vuplus'): self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) ConfigListScreen.__init__(self, self.list, session = self.session) #self["config"].list = self.list #self["config"].setList(self.list) self["config"].l.setSeperation(300) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"], { "ok": self.save, "cancel": self.revert, "red": self.revert, "green": self.save, "menu": self.closeRecursive, }, -1)
def revert(self): for count in range(fancontrol.getFanCount()): if getBrandOEM() not in ('dags', 'vuplus'): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() if getBrandOEM() not in ('dags', 'vuplus'): fancontrol.getConfig(count).vlt_standby.load() fancontrol.getConfig(count).pwm_standby.load() self.close()
def save(self): for count in range(fancontrol.getFanCount()): if getBrandOEM() not in ("dags", "vuplus"): fancontrol.getConfig(count).vlt.save() fancontrol.getConfig(count).pwm.save() if getBrandOEM() not in ("dags", "vuplus"): fancontrol.getConfig(count).vlt_standby.save() fancontrol.getConfig(count).pwm_standby.save() self.close()
def revert(self): for count in range(fancontrol.getFanCount()): if not getBoxType().startswith('tm') or not getBoxType().startswith('vu'): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() if not getBoxType().startswith('tm') or not getBoxType().startswith('vu'): fancontrol.getConfig(count).vlt_standby.load() fancontrol.getConfig(count).pwm_standby.load() self.close()
def createSetup(self): self.list = [] for count in range(fancontrol.getFanCount()): self.list.append(getConfigListEntry(_("Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) self.list.append(getConfigListEntry(_("Standby Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) self.list.append(getConfigListEntry(_("Standby Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) self["config"].list = self.list self["config"].l.setList(self.list)
def revert(self): for count in range(fancontrol.getFanCount()): stb = HardwareInfo().get_device_name() if stb not in ('optimussos1', 'optimussos2', 'solo2'): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() if stb not in ('optimussos1', 'optimussos2', 'solo2'): fancontrol.getConfig(count).vlt_standby.load() fancontrol.getConfig(count).pwm_standby.load() self.close()
def __init__(self, session, args = None): Screen.__init__(self, session) self.setTitle(_("Temperature and fan control")) templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE) tempcount = len(templist) fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM) fancount = len(fanlist) self["red"] = StaticText(_("Cancel")) self["green"] = StaticText(_("OK")) self["yellow"] = StaticText("") self["blue"] = StaticText("") for count in range(8): if count < tempcount: id = templist[count] self["SensorTempText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorTemp%d" % count] = SensorSource(sensorid = id) else: self["SensorTempText%d" % count] = StaticText("") self["SensorTemp%d" % count] = SensorSource() if count < fancount: id = fanlist[count] self["SensorFanText%d" % count] = StaticText(sensors.getSensorName(id)) self["SensorFan%d" % count] = SensorSource(sensorid = id) else: self["SensorFanText%d" % count] = StaticText("") self["SensorFan%d" % count] = SensorSource() self.list = [] for count in range(fancontrol.getFanCount()): self.list.append(getConfigListEntry(_("Fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) self.list.append(getConfigListEntry(_("Standby fan %d voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) self.list.append(getConfigListEntry(_("Standby fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) ConfigListScreen.__init__(self, self.list, session = self.session) #self["config"].list = self.list #self["config"].setList(self.list) self["config"].l.setSeperation(300) seperation = skin.parameters.get("ConfigListSeperator", 300) self["config"].l.setSeperation(seperation) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"], { "ok": self.save, "cancel": self.revert, "red": self.revert, "green": self.save, "menu": self.closeRecursive, }, -1)
def addSensors(self): import os if os.path.exists("/proc/stb/sensors"): for dirname in os.listdir("/proc/stb/sensors"): if dirname.find("temp", 0, 4) == 0: name = open("/proc/stb/sensors/%s/name" % dirname, "r").readline().strip() unit = open("/proc/stb/sensors/%s/unit" % dirname, "r").readline().strip() 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 %d") % (fanid + 1), "rpm", fanid))
def revert(self): for count in range(fancontrol.getFanCount()): if not getBoxType().startswith( 'tm') or not getBoxType().startswith('vu'): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() if not getBoxType().startswith( 'tm') or not getBoxType().startswith('vu'): fancontrol.getConfig(count).vlt_standby.load() fancontrol.getConfig(count).pwm_standby.load() self.close()
def addSensors(self): import os if os.path.exists('/proc/stb/sensors'): for dirname in os.listdir('/proc/stb/sensors'): if dirname.find('temp', 0, 4) == 0: name = open('/proc/stb/sensors/%s/name' % dirname, 'r').readline().strip() unit = open('/proc/stb/sensors/%s/unit' % dirname, 'r').readline().strip() 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 %d') % (fanid + 1), 'rpm', fanid))