bug: fix incorrect model for XP.
This commit is contained in:
@@ -915,10 +915,11 @@ class MinerFactory:
|
|||||||
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")
|
||||||
try:
|
try:
|
||||||
miner_model = sock_json_data["DEVDETAILS"][0]["Model"].replace(
|
miner_model = (
|
||||||
"Bitmain ", ""
|
sock_json_data["DEVDETAILS"][0]["Model"]
|
||||||
|
.replace("Bitmain ", "")
|
||||||
|
.replace("S19XP", "S19 XP")
|
||||||
)
|
)
|
||||||
|
|
||||||
return miner_model
|
return miner_model
|
||||||
except (TypeError, LookupError):
|
except (TypeError, LookupError):
|
||||||
pass
|
pass
|
||||||
@@ -931,7 +932,9 @@ class MinerFactory:
|
|||||||
)
|
)
|
||||||
if d.status_code == 200:
|
if d.status_code == 200:
|
||||||
json_data = d.json()
|
json_data = d.json()
|
||||||
miner_model = json_data["data"]["bosminer"]["info"]["modelName"]
|
miner_model = json_data["data"]["bosminer"]["info"][
|
||||||
|
"modelName"
|
||||||
|
].replace("S19XP", "S19 XP")
|
||||||
return miner_model
|
return miner_model
|
||||||
except (httpx.HTTPError, LookupError):
|
except (httpx.HTTPError, LookupError):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user