Add some logging
This commit is contained in:
parent
920fdb5955
commit
91b720e26b
1 changed files with 4 additions and 1 deletions
|
|
@ -21,10 +21,12 @@ def send_open_door_request(host, username, password):
|
|||
|
||||
|
||||
def get_ring_status(host, username, password):
|
||||
url = f"http://{host}/local/Doorcom/monitor.cgi?ring=1"
|
||||
print(f"sending request to {url}", flush=True)
|
||||
try:
|
||||
response = urllib3.PoolManager().request(
|
||||
"GET",
|
||||
f"http://{host}/local/Doorcom/monitor.cgi?ring=1",
|
||||
url,
|
||||
headers=urllib3.make_headers(basic_auth=f"{username}:{password}"),
|
||||
preload_content=False,
|
||||
decode_content=True,
|
||||
|
|
@ -48,6 +50,7 @@ def get_ring_status(host, username, password):
|
|||
data.append(line.decode().rstrip())
|
||||
else:
|
||||
if data:
|
||||
print(f"received: {data}", flush=True)
|
||||
yield data
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue