diff options
| author | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-09-01 02:03:56 +0000 |
|---|---|---|
| committer | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-09-01 02:03:56 +0000 |
| commit | 4ea253d6b26b2f997c8fade1d3ac837034d1204b (patch) | |
| tree | 5dc2022cefdd89e7a6960bde86022a913b379663 /lib/python/Components/SetupDevices.py | |
| parent | 0d59650e25c7f1176346bfdfe2186aba9ee7089c (diff) | |
| download | enigma2-4ea253d6b26b2f997c8fade1d3ac837034d1204b.tar.gz enigma2-4ea253d6b26b2f997c8fade1d3ac837034d1204b.zip | |
added lcd controls
Diffstat (limited to 'lib/python/Components/SetupDevices.py')
| -rw-r--r-- | lib/python/Components/SetupDevices.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/python/Components/SetupDevices.py b/lib/python/Components/SetupDevices.py index 16118cad..7ffdd109 100644 --- a/lib/python/Components/SetupDevices.py +++ b/lib/python/Components/SetupDevices.py @@ -1,3 +1,5 @@ +import os + from config import config #global config instance from config import configElement @@ -5,6 +7,18 @@ from config import ConfigSubsection from config import ConfigSlider from config import configBoolean +#temp. class for exhibition + +class LCD: + def __init__(self): + pass + + def setBright(self, value): + os.system("lcddimm " + str(value * 10)) + + def setContrast(self, value): + os.system("lcdcontrast " + str(value * 6)) + def InitSetupDevices(): config.timezone = ConfigSubsection(); config.timezone.val = configElement("", configBoolean, 1, ("GMT", "GMT+1", "GMT+2", "GMT+3", "GMT+4", "GMT+5", "GMT+6", "GMT+7", "GMT+8", "GMT+9") ); @@ -39,9 +53,21 @@ def InitSetupDevices(): config.lcd = ConfigSubsection(); config.lcd.bright = configElement("", ConfigSlider, 7, ""); + config.lcd.contrast = configElement("", ConfigSlider, 2, ""); config.lcd.standby = configElement("", ConfigSlider, 1, ""); config.lcd.invert = configElement("", configBoolean, 1, ("Enable", "Disable") ); + ilcd = LCD() + + def setLCDbright(configElement): + ilcd.setBright(configElement.value); + + def setLCDcontrast(configElement): + ilcd.setContrast(configElement.value); + + config.lcd.bright.addNotifier(setLCDbright); + config.lcd.contrast.addNotifier(setLCDcontrast); + config.parental = ConfigSubsection(); config.parental.lock = configElement("", configBoolean, 1, ("Enable", "Disable") ); config.parental.setuplock = configElement("", configBoolean, 1, ("Enable", "Disable") ); |
