blob: b5b2d438d1f50f9bdc12ec525fac2728eb93377a [file] [log] [blame]
#!/usr/bin/python
import dbus, flimflam, sys
if (len(sys.argv) < 4):
print "Usage: %s <device-name> <property> <value>" % (sys.argv[0])
sys.exit(1)
(_, name, property_key, value) = sys.argv
flim = flimflam.FlimFlam()
device = flim.FindElementByNameSubstring('Device', name)
if property_key in ["BgscanShortInterval", "RoamThreshold", "ScanInterval" ]:
device.SetProperty(property_key, dbus.UInt16(value))
elif property_key in [ "BgscanSignalThreshold", ]:
device.SetProperty(property_key, dbus.Int32(value))
elif property_key in ["Cellular.AllowRoaming", "Powered"]:
device.SetProperty(property_key,
dbus.Boolean(value.lower() in ("true", "1")))
else:
device.SetProperty(property_key, value)