bug: fix auradine identification.

This commit is contained in:
b-rowan
2024-01-24 17:33:41 -07:00
parent af354fd8e2
commit edf31ae7df

View File

@@ -967,27 +967,10 @@ class MinerFactory:
pass
async def get_miner_model_auradine(self, ip: str):
sock_json_data = await self.send_api_command(ip, "devdetails")
try:
async with httpx.AsyncClient(transport=settings.transport()) as client:
auth = await client.post(
f"http://{ip}:8080/token",
data={
"command": "token",
"username": "admin",
"password": settings.get(
"default_auradine_web_password", "admin"
),
},
timeout=settings.get("factory_get_timeout", 3),
)
token = auth.json()["Token"][0]["Token"]
web_json_data = await client.get(
f"http://{ip}:8080/ipreport",
headers={"Token": token},
timeout=settings.get("factory_get_timeout", 3),
)
return web_json_data.json()["IPReport"][0]["model"]
except (TypeError, LookupError, httpx.HTTPError):
return sock_json_data["DEVDETAILS"][0]["Model"]
except LookupError:
pass