bug: fix is_mining for some miners.

This commit is contained in:
UpstreamData
2023-06-23 14:33:32 -06:00
parent 65fd66b8bf
commit 65d1695ce4
2 changed files with 21 additions and 0 deletions

View File

@@ -451,3 +451,15 @@ class AntminerOld(CGMiner):
return False if int(web_get_conf["bitmain-work-mode"]) == 1 else True
except LookupError:
pass
api_summary = None
try:
api_summary = await self.api.summary()
except APIError:
pass
if api_summary is not None:
if not api_summary == {}:
return True
else:
return False

View File

@@ -192,3 +192,12 @@ class AntminerOldWebAPI(BaseWebAPI):
async def set_miner_conf(self, conf: dict) -> dict:
return await self.send_command("set_miner_conf", **conf)
async def stats(self) -> dict:
return await self.send_command("miner_stats")
async def summary(self) -> dict:
return await self.send_command("miner_summary")
async def pools(self) -> dict:
return await self.send_command("miner_pools")