bug: fix hashboard innosilicon model selection
This commit is contained in:
@@ -941,10 +941,19 @@ class MinerFactory:
|
|||||||
async with httpx.AsyncClient(transport=settings.transport()) as session:
|
async with httpx.AsyncClient(transport=settings.transport()) as session:
|
||||||
auth_req = await session.post(
|
auth_req = await session.post(
|
||||||
f"http://{ip}/api/auth",
|
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"]
|
auth = auth_req.json()["jwt"]
|
||||||
|
except (httpx.HTTPError, LookupError):
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
async with httpx.AsyncClient(transport=settings.transport()) as session:
|
||||||
web_data = (
|
web_data = (
|
||||||
await session.post(
|
await session.post(
|
||||||
f"http://{ip}/api/type",
|
f"http://{ip}/api/type",
|
||||||
@@ -955,6 +964,18 @@ class MinerFactory:
|
|||||||
return web_data["type"]
|
return web_data["type"]
|
||||||
except (httpx.HTTPError, LookupError):
|
except (httpx.HTTPError, LookupError):
|
||||||
pass
|
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:
|
async def get_miner_model_braiins_os(self, ip: str) -> str | None:
|
||||||
sock_json_data = await self.send_api_command(ip, "devdetails")
|
sock_json_data = await self.send_api_command(ip, "devdetails")
|
||||||
|
|||||||
Reference in New Issue
Block a user