Enigma2-Network: update Wlan plugin to support new python-wifi.
[enigma2.git] / lib / python / Components / NimManager.py
index 70ed7c4ac32efcc98a1030e5624152ca190af598..a69df009260a79250d4444bbdbd2b1a233f5ad27 100644 (file)
@@ -1168,7 +1168,7 @@ def InitNimManager(nimmgr):
                        section.latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)])
                        section.latitudeOrientation = ConfigSelection(latitude_orientation_choices, "north")
                        section.powerMeasurement = ConfigYesNo(default=True)
-                       section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100))
+                       section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm7025" and 50 or 15, limits=(0, 100))
                        section.turningSpeed = ConfigSelection(turning_speed_choices, "fast")
                        section.fastTurningBegin = ConfigDateTime(default=advanced_lnb_fast_turning_btime, formatstring = _("%H:%M"), increment = 600)
                        section.fastTurningEnd = ConfigDateTime(default=advanced_lnb_fast_turning_etime, formatstring = _("%H:%M"), increment = 600)
@@ -1257,9 +1257,19 @@ def InitNimManager(nimmgr):
        def tunerTypeChanged(nimmgr, configElement):
                fe_id = configElement.fe_id
                print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value)
-               open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
+               try:
+                       oldvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
                frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend()
+               frontend.closeFrontend()
+               open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
                frontend.reopenFrontend()
+               try:
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(oldvalue)
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
                nimmgr.enumerateNIMs()
        
        empty_slots = 0