bug: fix auradine identification.
This commit is contained in:
@@ -967,27 +967,10 @@ class MinerFactory:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def get_miner_model_auradine(self, ip: str):
|
async def get_miner_model_auradine(self, ip: str):
|
||||||
|
sock_json_data = await self.send_api_command(ip, "devdetails")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(transport=settings.transport()) as client:
|
return sock_json_data["DEVDETAILS"][0]["Model"]
|
||||||
auth = await client.post(
|
except LookupError:
|
||||||
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):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user