d66437eb88a4ae2486c4c2eb125ebd6161d62d3d
[vuplus_dvbapp] / lib / python / Components / SystemInfo.py
1 from enigma import eDVBResourceManager, eDVBCIInterfaces
2 from Tools.Directories import fileExists, fileCheck
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"] = HardwareInfo().get_device_name() != "dm800"
32 SystemInfo["HdmiInSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "uno4kse", "duo4k")
33 SystemInfo["WOWLSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "duo4k")
34 SystemInfo["ScrambledPlayback"] = "PVR" in open("/proc/stb/tsmux/ci0_input_choices").read()
35 SystemInfo["FastChannelChange"] =  fileExists("/proc/stb/frontend/fbc/fcc")
36 SystemInfo["MiniTV"] = fileExists("/proc/stb/lcd/live_enable")
37 SystemInfo["DisableUsbRecord"] = HardwareInfo().get_vu_device_name() in ("solo4k", "uno4kse", "zero4k", "duo4k")
38 SystemInfo["DefaultAniSpeed"] = HardwareInfo().get_vu_device_name() in ("uno4k", "uno4kse", "zero4k", "duo4k") and 25 or 20
39 SystemInfo["DefaultFullHDSkin"] = HardwareInfo().get_vu_device_name() in ("solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k")
40 SystemInfo["PVRSupport"] = HardwareInfo().get_vu_device_name() not in ["solose", "zero", "uno4k"]
41
42 SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
43 SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
44 for cislot in range (0, SystemInfo["CommonInterface"]):
45         SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk"  % cislot)
46         SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing"  % cislot)