4.2.0r10
[enigma2.git] / usr / lib / enigma2 / python / Components / SystemInfo.py
1 from enigma import eDVBResourceManager
2 from Tools.Directories import fileExists
3 from Tools.HardwareInfo import HardwareInfo
4
5 SystemInfo = { }
6
7 #FIXMEE...
8 def getNumVideoDecoders():
9         idx = 0
10         while fileExists("/dev/dvb/adapter0/video%d"%(idx), 'f'):
11                 idx += 1
12         return idx
13
14 SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
15 SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
16
17
18 def countFrontpanelLEDs():
19         leds = 0
20         if fileExists("/proc/stb/fp/led_set_pattern"):
21                 leds += 1
22
23         while fileExists("/proc/stb/fp/led%d_pattern" % leds):
24                 leds += 1
25
26         return leds
27
28 SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
29 SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
30 SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
31 SystemInfo["DeepstandbySupport"] = True
32 try:
33         from Plugins.SystemPlugins.NetworkManager import plugin
34         SystemInfo["NetworkManager"] = True
35 except:
36         SystemInfo["NetworkManager"] = False