forked from freespace/pyAPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_info.py
More file actions
30 lines (21 loc) · 674 Bytes
/
Copy pathget_info.py
File metadata and controls
30 lines (21 loc) · 674 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
#!/usr/bin/env python
"""
Usage: python get_info.py [<serial>]
Gets the controller information of all APT controllers, or the one specified
"""
from __future__ import absolute_import
from __future__ import print_function
import pyAPT
from runner import runner_serial
@runner_serial
def info(serial):
with pyAPT.Controller(serial_number=serial) as con:
info = con.info()
print('\tController info:')
labels=['S/N','Model','Type','Firmware Ver', 'Notes', 'H/W Ver',
'Mod State', 'Channels']
for idx,ainfo in enumerate(info):
print('\t%12s: %s'%(labels[idx], bytes(ainfo)))
if __name__ == '__main__':
import sys
sys.exit(info())