-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (21 loc) · 674 Bytes
/
test.py
File metadata and controls
23 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
import asyncio
import logging
import usr_r16
async def connect():
client = await usr_r16.create_usr_r16_client_connection(host, port=8899, password='admin', loop=loop, timeout=60, reconnect_interval=10)
status = await client.status(16)
print(status)
await asyncio.sleep(10)
status = await client.status(15)
print(status)
await asyncio.sleep(10)
status = await client.status(16)
print(status)
host, name = usr_r16.USR16Protocol.discover()
print(host)
print(name)
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
if host:
loop = asyncio.get_event_loop()
loop.create_task(connect())
loop.run_forever()