diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Lcd.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py new file mode 100644 index 00000000..7d5ac283 --- /dev/null +++ b/lib/python/Components/Lcd.py @@ -0,0 +1,47 @@ +from config import config #global config instance +from config import ConfigSlider +from config import configSelection +from config import ConfigSubsection +from config import configElement + +from enigma import * + +class LCD: + def __init__(self): + pass + + def setBright(self, value): + eDBoxLCD.getInstance().setLCDBrightness(value * 20) + pass + + def setContrast(self, value): + eDBoxLCD.getInstance().setLCDContrast(value) + pass + + def setInverted(self, value): + eDBoxLCD.getInstance().setInverted(value) + pass + +def InitLcd(): + config.lcd = ConfigSubsection(); + config.lcd.bright = configElement("config.lcd.bright", ConfigSlider, 7, ""); + config.lcd.contrast = configElement("config.lcd.contrast", ConfigSlider, 2, ""); + config.lcd.standby = configElement("config.lcd.standby", ConfigSlider, 1, ""); + config.lcd.invert = configElement("config.lcd.invert", configSelection, 1, ("Disable", "Enable") ); + + ilcd = LCD() + + def setLCDbright(configElement): + ilcd.setBright(configElement.value); + + def setLCDcontrast(configElement): + ilcd.setContrast(configElement.value); + + def setLCDinverted(configElement): + ilcd.setInverted(configElement.value); + + config.lcd.bright.addNotifier(setLCDbright); + config.lcd.contrast.addNotifier(setLCDcontrast); + config.lcd.invert.addNotifier(setLCDinverted); + +
\ No newline at end of file |
