Merge branch 'master' of /home/tmbinc/enigma2-git
[enigma2.git] / lib / python / Components / SystemInfo.py
1 from enigma import eDVBResourceManager
2 from Tools.Directories import fileExists
3
4 SystemInfo = { }
5
6 #FIXMEE...
7 def getNumVideoDecoders():
8         idx = 0
9         while fileExists("/dev/dvb/adapter0/video%d"%(idx), 'f'):
10                 idx += 1
11         return idx
12
13 SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
14 SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
15
16
17 def countFrontpanelLEDs():
18         leds = 0
19         if fileExists("/proc/stb/fp/led_set_pattern"):
20                 leds += 1
21
22         while fileExists("/proc/stb/fp/led%d_pattern" % leds):
23                 leds += 1
24
25         return leds
26
27 SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
28 SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
29 SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")