set hdd standby value for all hdds (not working on hotplug devices,
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 28 Jul 2008 10:58:01 +0000 (10:58 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 28 Jul 2008 10:58:01 +0000 (10:58 +0000)
plugged in while e2 is running)

lib/python/Components/Harddisk.py
lib/python/Components/UsageConfig.py

index 9c695a2..dfc262d 100644 (file)
@@ -203,6 +203,12 @@ class Harddisk:
                        return -3
 
                return 0
+       
+       def getDeviceDir(self):
+               return self.devidex
+       
+       def getDeviceName(self):
+               return self.getDeviceDir() + "disc"
 
 class Partition:
        def __init__(self, mountpoint, description = "", force_mounted = False):
index 269d5a2..d9fb2a5 100644 (file)
@@ -1,3 +1,4 @@
+from Components.Harddisk import harddiskmanager
 from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet
 from enigma import Misc_Options, setTunerTypePriorityOrder;
 from SystemInfo import SystemInfo
@@ -60,7 +61,8 @@ def InitUsageConfig():
        config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged)
 
        def setHDDStandby(configElement):
-               os.system("hdparm -S" + configElement.value + " /dev/ide/host0/bus0/target0/lun0/disc")
+               for hdd in harddiskmanager.HDDList():
+                       os.system("hdparm -S%s %s" % (configElement.value, hdd[1].getDeviceName()))
        config.usage.hdd_standby.addNotifier(setHDDStandby)
 
        def set12VOutput(configElement):