-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathListDevices.py
More file actions
36 lines (28 loc) · 891 Bytes
/
ListDevices.py
File metadata and controls
36 lines (28 loc) · 891 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
31
32
33
34
35
36
# ListDevices.py
#
# This example prints all the available devices to the screen.
#
# Find more information on http://www.tiepie.com/LibTiePie .
from __future__ import print_function
import sys
import time
import libtiepie
from printinfo import *
# Print library info:
print_library_info()
# Enable network search:
libtiepie.network.auto_detect_enabled = True
# Search for devices:
libtiepie.device_list.update()
if len(libtiepie.device_list) > 0:
print()
print('Available devices:')
for item in libtiepie.device_list:
print(' Name: ' + item.name)
print(' Serial number : ' + str(item.serial_number))
print(' Available types: ' + libtiepie.device_type_str(item.types))
if item.has_server:
print(' Server : ' + item.server.url + ' (' + item.server.name + ')')
else:
print('No devices found!')
sys.exit(0)