bug: fix a bug with very new versions of btminer hashboards
This commit is contained in:
@@ -426,21 +426,22 @@ class BTMiner(StockFirmware):
|
|||||||
if rpc_devs is not None:
|
if rpc_devs is not None:
|
||||||
try:
|
try:
|
||||||
for board in rpc_devs["DEVS"]:
|
for board in rpc_devs["DEVS"]:
|
||||||
if len(hashboards) < board["ASC"] + 1:
|
asc = board.get("ASC")
|
||||||
|
if asc is None:
|
||||||
|
asc = board["Slot"]
|
||||||
|
if len(hashboards) < asc + 1:
|
||||||
hashboards.append(
|
hashboards.append(
|
||||||
HashBoard(
|
HashBoard(slot=asc, expected_chips=self.expected_chips)
|
||||||
slot=board["ASC"], expected_chips=self.expected_chips
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
self.expected_hashboards += 1
|
self.expected_hashboards += 1
|
||||||
hashboards[board["ASC"]].chip_temp = round(board["Chip Temp Avg"])
|
hashboards[asc].chip_temp = round(board["Chip Temp Avg"])
|
||||||
hashboards[board["ASC"]].temp = round(board["Temperature"])
|
hashboards[asc].temp = round(board["Temperature"])
|
||||||
hashboards[board["ASC"]].hashrate = self.algo.hashrate(
|
hashboards[asc].hashrate = self.algo.hashrate(
|
||||||
rate=float(board["MHS 1m"]), unit=self.algo.unit.MH
|
rate=float(board["MHS 1m"]), unit=self.algo.unit.MH
|
||||||
).into(self.algo.unit.default)
|
).into(self.algo.unit.default)
|
||||||
hashboards[board["ASC"]].chips = board["Effective Chips"]
|
hashboards[asc].chips = board["Effective Chips"]
|
||||||
hashboards[board["ASC"]].serial_number = board["PCB SN"]
|
hashboards[asc].serial_number = board["PCB SN"]
|
||||||
hashboards[board["ASC"]].missing = False
|
hashboards[asc].missing = False
|
||||||
except LookupError:
|
except LookupError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user