bug: fix hashboard innosilicon model selection

This commit is contained in:
Upstream Data
2024-10-30 10:32:29 -06:00
parent b8874092ad
commit acdafc2efd

View File

@@ -941,10 +941,19 @@ class MinerFactory:
async with httpx.AsyncClient(transport=settings.transport()) as session:
auth_req = await session.post(
f"http://{ip}/api/auth",
data={"username": "admin", "password": "admin"},
data={
"username": "admin",
"password": settings.get(
"default_innosilicon_web_password", "admin"
),
},
)
auth = auth_req.json()["jwt"]
except (httpx.HTTPError, LookupError):
return
try:
async with httpx.AsyncClient(transport=settings.transport()) as session:
web_data = (
await session.post(
f"http://{ip}/api/type",
@@ -955,6 +964,18 @@ class MinerFactory:
return web_data["type"]
except (httpx.HTTPError, LookupError):
pass
try:
async with httpx.AsyncClient(transport=settings.transport()) as session:
web_data = (
await session.post(
f"http://{ip}/overview",
headers={"Authorization": "Bearer " + auth},
data={},
)
).json()
return web_data["type"]
except (httpx.HTTPError, LookupError):
pass
async def get_miner_model_braiins_os(self, ip: str) -> str | None:
sock_json_data = await self.send_api_command(ip, "devdetails")