From ebb18fe31efe7c97288f815950020b3f2dd6af98 Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Wed, 9 Nov 2005 02:18:30 +0000 Subject: add lcd --- lib/python/Components/Lcd.py | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lib/python/Components/Lcd.py (limited to 'lib/python') 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 -- cgit v1.2.3