fixed some small bugs with miner factory

This commit is contained in:
UpstreamData
2022-01-12 11:50:43 -07:00
parent cdc6c898ae
commit d5fc7650ef
2 changed files with 7 additions and 4 deletions

View File

@@ -94,7 +94,10 @@ class MinerFactory:
if "Antminer S9" in model:
# handle the different API types
if "BOSMiner" in api:
if not api:
print(ip)
miner = BOSMinerS9(str(ip))
elif "BOSMiner" in api:
miner = BOSMinerS9(str(ip))
elif "CGMiner" in api:
miner = CGMinerS9(str(ip))

View File

@@ -3,9 +3,9 @@ from network import MinerNetwork
from miners.bosminer import BOSMiner
async def get_bos_bad_tuners():
async def get_bos_bad_tuners(ip: str = "192.168.1.0", mask: int = 24):
# create a miner network
miner_network = MinerNetwork("192.168.1.0")
miner_network = MinerNetwork(ip, mask=mask)
# scan for miners
miners = await miner_network.scan_network_for_miners()
@@ -29,7 +29,7 @@ async def get_bos_bad_tuners():
bad_boards = []
for board in item["tuner_status"]:
# if its not stable or still testing, its bad
if board["status"] not in ["Stable", "Testing performance profile"]:
if board["status"] not in ["Stable", "Testing performance profile", "Tuning individual chips"]:
# remove the part about the board refusing to start
bad_boards.append({"board": board["board"],
"error": board["status"].replace("Hashchain refused to start: ", "")})