fixed a bug with model not reading if there are no hashboards in the miner
This commit is contained in:
@@ -95,8 +95,9 @@ class BOSMiner(BaseMiner):
|
|||||||
return self.model + " (BOS)"
|
return self.model + " (BOS)"
|
||||||
version_data = await self.api.devdetails()
|
version_data = await self.api.devdetails()
|
||||||
if version_data:
|
if version_data:
|
||||||
self.model = version_data["DEVDETAILS"][0]["Model"].replace("Antminer ", "")
|
if not version_data["DEVDETAILS"] == []:
|
||||||
return self.model + " (BOS)"
|
self.model = version_data["DEVDETAILS"][0]["Model"].replace("Antminer ", "")
|
||||||
|
return self.model + " (BOS)"
|
||||||
return None
|
return None
|
||||||
|
|
||||||
async def send_config(self, yaml_config) -> None:
|
async def send_config(self, yaml_config) -> None:
|
||||||
|
|||||||
@@ -131,10 +131,11 @@ class MinerFactory:
|
|||||||
if data["VERSION"][0].get("Type"):
|
if data["VERSION"][0].get("Type"):
|
||||||
model = data["VERSION"][0]["Type"]
|
model = data["VERSION"][0]["Type"]
|
||||||
else:
|
else:
|
||||||
if not data["DEVDETAILS"][0]["Model"] == "":
|
if "DEVDETAILS" in data.keys() and not data["DEVDETAILS"] == []:
|
||||||
model = data["DEVDETAILS"][0]["Model"]
|
if not data["DEVDETAILS"][0]["Model"] == "":
|
||||||
else:
|
model = data["DEVDETAILS"][0]["Model"]
|
||||||
model = data["DEVDETAILS"][0]["Driver"]
|
else:
|
||||||
|
model = data["DEVDETAILS"][0]["Driver"]
|
||||||
else:
|
else:
|
||||||
data = await self._send_api_command(str(ip), "version")
|
data = await self._send_api_command(str(ip), "version")
|
||||||
model = data["VERSION"][0]["Type"]
|
model = data["VERSION"][0]["Type"]
|
||||||
|
|||||||
Reference in New Issue
Block a user