Add request timeout

This commit is contained in:
Jakob Lechner 2024-01-30 20:10:51 +00:00
parent c7ef9fb1e8
commit 920fdb5955

View file

@ -8,7 +8,12 @@ import time
def send_open_door_request(host, username, password):
urllib3.PoolManager().request(
urllib3.PoolManager(
timeout=urllib3.Timeout(
connect=3.0,
read=300,
)
).request(
"GET",
f"http://{host}/local/Doorcom/door.cgi?r=1",
headers=urllib3.make_headers(basic_auth=f"{username}:{password}"),