blob: 204ea6e128afd4b2355f3c0f592a98109e8df8fc [file] [log] [blame]
Christopher Wiley2f48d952013-02-22 09:51:47 -08001#!/usr/bin/python
2
3import dbus, flimflam, sys
4
5if (len(sys.argv) < 4):
6 print "Usage: %s <device-name> <property> <value>" % (sys.argv[0])
7 sys.exit(1)
8
9(_, name, property_key, value) = sys.argv
10
11flim = flimflam.FlimFlam()
12device = flim.FindElementByNameSubstring('Device', name)
13if property_key in ["BgscanShortInterval", "ScanInterval" ]:
14 device.SetProperty(property_key, dbus.Int16(value))
15elif property_key in [ "BgscanSignalThreshold", ]:
16 device.SetProperty(property_key, int(value))
17elif property_key in ["Cellular.AllowRoaming", "Powered"]:
18 device.SetProperty(property_key,
19 dbus.Boolean(value.lower() in ("true", "1")))
20else:
21 device.SetProperty(property_key, value)