added Hive get bad boards, and started on a bad board utility

This commit is contained in:
UpstreamData
2022-01-21 16:15:46 -07:00
parent a1839aae46
commit a93027369e
10 changed files with 82 additions and 10 deletions

View File

@@ -1,4 +1,7 @@
import asyncio
from miners.bmminer import BMMiner
import json
class HiveonT9(BMMiner):
@@ -9,3 +12,18 @@ class HiveonT9(BMMiner):
def __repr__(self) -> str:
return f"HiveonT9: {str(self.ip)}"
async def get_bad_boards(self) -> list:
"""Checks for and provides list of non working boards."""
board_stats = await self.api.stats()
stats = board_stats['STATS'][1]
bad_boards = []
board_chains = {6: [2, 9, 10], 7: [3, 11, 12], 8: [4, 13, 14]}
for board in board_chains:
for chain in board_chains[board]:
count = stats[f"chain_acn{chain}"]
chips = stats[f"chain_acs{chain}"].replace(" ", "")
if not count == 18 or "x" in chips:
bad_boards.append({"board": board, "chain": chain, "chip_count": count, "chip_status": chips})
return bad_boards