-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathowScanBuss
More file actions
executable file
·30 lines (22 loc) · 935 Bytes
/
Copy pathowScanBuss
File metadata and controls
executable file
·30 lines (22 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
import argparse
import ow, OwConfig, OwLib
parser = argparse.ArgumentParser(description="Locates devices in OwConfig.sensor_list on a list of servers.")
parser.add_argument("-d", "--debug",
dest="debug", default=0, action="count",
help="Increase the debug level")
parser.add_argument("servers", default=["localhost:4304"],
nargs="+",
help="Specify address for owservers to scan. Default is %(default)s")
args = parser.parse_args()
OwConfig.debug = args.debug
OwLib.debug = args.debug
for server in args.servers:
ow.init(server)
print "Scanning", server
all_sensors = OwLib.find_all_sensors()
OwConfig.init_sensor_list(server, all_sensors)
ow.finish();
for s,c in OwConfig.sensor_list.iteritems():
if 'sensor' in c.keys():
print "{:4s} {:15s} {:12s} {}".format(c['label'], s, c['server'], c['sensor'])