b3fae0216e58fb5c9556991ef1b41c2db8def8c1
[openblackhole/openblackhole-enigma2.git] / lib / python / Components / SystemInfo.py
1 from enigma import eDVBResourceManager, Misc_Options
2 from Tools.Directories import fileExists, fileCheck, pathExists
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["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
16 SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
17
18
19 def countFrontpanelLEDs():
20         leds = 0
21         if fileExists("/proc/stb/fp/led_set_pattern"):
22                 leds += 1
23
24         while fileExists("/proc/stb/fp/led%d_pattern" % leds):
25                 leds += 1
26
27         return leds
28
29 SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
30 SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
31 SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
32 SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
33 SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
34 SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
35 SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
36 SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
37 SystemInfo["StandbyLED"] = fileCheck("/proc/stb/power/standbyled")
38 SystemInfo["WakeOnLAN"] = not HardwareInfo().get_device_model().startswith("et8000") and fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
39 SystemInfo["HasExternalPIP"] = not HardwareInfo().get_device_model().startswith("et9") and fileCheck("/proc/stb/vmpeg/1/external")
40 SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
41 SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
42 SystemInfo["VFD_scroll_repeats"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/scroll_repeats")
43 SystemInfo["VFD_scroll_delay"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/scroll_delay")
44 SystemInfo["VFD_initial_scroll_delay"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/initial_scroll_delay")
45 SystemInfo["VFD_final_scroll_delay"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/final_scroll_delay")
46 SystemInfo["LcdLiveTV"] = fileCheck("/proc/stb/fb/sd_detach")
47 SystemInfo["3DMode"] = fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d")
48 SystemInfo["3DZNorm"] = fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset")
49 SystemInfo["Blindscan_t2_available"] = fileCheck("/proc/stb/info/vumodel")
50 SystemInfo["RcTypeChangable"] = not (HardwareInfo().get_device_model().startswith('et8500') or HardwareInfo().get_device_model().startswith('et7')) and pathExists('/proc/stb/ir/rc/type')