Components/SystemInfo.py: add new SystemInfo entry "DeepstandbySupport"
[enigma2.git] / lib / python / Components / SystemInfo.py
index d074c41407ced50ebea7bc509bfc4ddbf1cdf19a..f9c4065fa951e2f5d2d595b52bc0775b2b896843 100644 (file)
@@ -1,10 +1,11 @@
 from enigma import eDVBResourceManager
+from Tools.Directories import fileExists
+from Tools.HardwareInfo import HardwareInfo
 
 SystemInfo = { }
 
 #FIXMEE...
 def getNumVideoDecoders():
-       from Tools.Directories import fileExists
        idx = 0
        while fileExists("/dev/dvb/adapter0/video%d"%(idx), 'f'):
                idx += 1
@@ -12,3 +13,19 @@ def getNumVideoDecoders():
 
 SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
 SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
+
+
+def countFrontpanelLEDs():
+       leds = 0
+       if fileExists("/proc/stb/fp/led_set_pattern"):
+               leds += 1
+
+       while fileExists("/proc/stb/fp/led%d_pattern" % leds):
+               leds += 1
+
+       return leds
+
+SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
+SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
+SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
+SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"