aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorRonny Strutz <ronny.strutz@multimedia-labs.de>2005-11-09 02:18:30 +0000
committerRonny Strutz <ronny.strutz@multimedia-labs.de>2005-11-09 02:18:30 +0000
commitebb18fe31efe7c97288f815950020b3f2dd6af98 (patch)
treee80db58f7020421785cefe1ceb6ce141ba4302a7 /lib/python
parent1f6edcca9e83bfe6e4606c48e5cb27fb637ca400 (diff)
downloadenigma2-ebb18fe31efe7c97288f815950020b3f2dd6af98.tar.gz
enigma2-ebb18fe31efe7c97288f815950020b3f2dd6af98.zip
add lcd
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Lcd.py47
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