X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FLcd.py;h=b043f393a636ac5464916ffe9ce517ddd3df074d;hp=42f15698123ec71318c67dc3d2024b1360ebf315;hb=e03c732afb410b4d6b9f9540c36c33c941ee38f1;hpb=d2ceae9583bc62daa872c316f8952b9a6a416a69 diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 42f1569..b043f39 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -1,35 +1,36 @@ -from config import config #global config instance -from config import ConfigSlider -from config import configSelection -from config import ConfigSubsection -from config import configElement +from config import config, ConfigSubsection, ConfigSlider, ConfigYesNo -from enigma import * +from enigma import eDBoxLCD class LCD: def __init__(self): pass def setBright(self, value): - eDBoxLCD.getInstance().setLCDBrightness(value * 20) - pass + value *= 255 + value /= 10 + if value > 255: + value = 255 + eDBoxLCD.getInstance().setLCDBrightness(value) def setContrast(self, value): + value *= 63 + value /= 20 + if value > 63: + value = 63 eDBoxLCD.getInstance().setLCDContrast(value) - pass def setInverted(self, value): if value: value = 255 eDBoxLCD.getInstance().setInverted(value) - pass def InitLcd(): config.lcd = ConfigSubsection(); - config.lcd.bright = configElement("config.lcd.bright", ConfigSlider, 10, ""); - config.lcd.contrast = configElement("config.lcd.contrast", ConfigSlider, 10, ""); - config.lcd.standby = configElement("config.lcd.standby", ConfigSlider, 0, ""); - config.lcd.invert = configElement("config.lcd.invert", configSelection, 0, ("Disable", "Enable") ); + config.lcd.bright = ConfigSlider(default=10, limits=(0, 10)) + config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) + config.lcd.standby = ConfigSlider(default=0, limits=(0, 10)) + config.lcd.invert = ConfigYesNo(default=False) ilcd = LCD() @@ -45,6 +46,3 @@ def InitLcd(): config.lcd.bright.addNotifier(setLCDbright); config.lcd.contrast.addNotifier(setLCDcontrast); config.lcd.invert.addNotifier(setLCDinverted); - - - \ No newline at end of file