@@ -20,6 +20,7 @@ async def setup(
20
20
auth_timeout_s = DEFAULT_AUTH_TIMEOUT_S ,
21
21
signer = None ,
22
22
transport_timeout_s = DEFAULT_TRANSPORT_TIMEOUT_S ,
23
+ log_errors = True ,
23
24
):
24
25
"""Connect to a device and determine whether it's an Android TV or an Amazon Fire TV.
25
26
@@ -45,6 +46,8 @@ async def setup(
45
46
The signer for the ADB keys, as loaded by :meth:`androidtv.adb_manager.adb_manager_async.ADBPythonAsync.load_adbkey`
46
47
transport_timeout_s : float
47
48
Transport timeout (in seconds)
49
+ log_errors: bool
50
+ Whether connection errors should be logged
48
51
49
52
Returns
50
53
-------
@@ -54,14 +57,18 @@ async def setup(
54
57
"""
55
58
if device_class == "androidtv" :
56
59
atv = AndroidTVAsync (host , port , adbkey , adb_server_ip , adb_server_port , state_detection_rules , signer )
57
- await atv .adb_connect (auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s )
60
+ await atv .adb_connect (
61
+ log_errors = log_errors , auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s
62
+ )
58
63
await atv .get_device_properties ()
59
64
await atv .get_installed_apps ()
60
65
return atv
61
66
62
67
if device_class == "firetv" :
63
68
ftv = FireTVAsync (host , port , adbkey , adb_server_ip , adb_server_port , state_detection_rules , signer )
64
- await ftv .adb_connect (auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s )
69
+ await ftv .adb_connect (
70
+ log_errors = log_errors , auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s
71
+ )
65
72
await ftv .get_device_properties ()
66
73
await ftv .get_installed_apps ()
67
74
return ftv
@@ -72,7 +79,9 @@ async def setup(
72
79
aftv = BaseTVAsync (host , port , adbkey , adb_server_ip , adb_server_port , state_detection_rules , signer )
73
80
74
81
# establish the ADB connection
75
- await aftv .adb_connect (auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s )
82
+ await aftv .adb_connect (
83
+ log_errors = log_errors , auth_timeout_s = auth_timeout_s , transport_timeout_s = transport_timeout_s
84
+ )
76
85
77
86
# get device properties
78
87
await aftv .get_device_properties ()
0 commit comments