From bcba2be524e4ab4f1d0cbbf668f8243e825b738b Mon Sep 17 00:00:00 2001 From: Upstream Data Date: Sat, 26 Aug 2023 10:56:17 -0600 Subject: [PATCH] bug: remove bad await calls to httpx response.json(). --- pyasic/miners/miner_factory.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyasic/miners/miner_factory.py b/pyasic/miners/miner_factory.py index 59432f1d..e3952a71 100644 --- a/pyasic/miners/miner_factory.py +++ b/pyasic/miners/miner_factory.py @@ -775,15 +775,13 @@ class MinerFactory: f"http://{ip}/api/auth", data={"username": "admin", "password": "admin"}, ) - auth = (await auth_req.json())["jwt"] + auth = auth_req.json()["jwt"] - web_data = await ( - await session.post( + web_data = (await session.post( f"http://{ip}/api/type", headers={"Authorization": "Bearer " + auth}, data={}, - ) - ).json() + )).json() return web_data["type"] except (httpx.HTTPError, LookupError): pass @@ -806,7 +804,7 @@ class MinerFactory: json={"query": "{bosminer {info{modelName}}}"}, ) if d.status_code == 200: - json_data = await d.json() + json_data = d.json() miner_model = json_data["data"]["bosminer"]["info"]["modelName"] return miner_model except (httpx.HTTPError, LookupError):