fixed formatting issues
This commit is contained in:
@@ -67,7 +67,7 @@ class BMMiner(BaseMiner):
|
||||
# return ? if we fail to get hostname with no ssh connection
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# return ? if we fail to get hostname with an exception
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
|
||||
@@ -23,6 +23,7 @@ class BOSMiner(BaseMiner):
|
||||
self.api_type = "BOSMiner"
|
||||
self.uname = "root"
|
||||
self.pwd = "admin"
|
||||
self.config = None
|
||||
|
||||
async def send_ssh_command(self, cmd: str) -> str or None:
|
||||
"""Send a command to the miner over ssh.
|
||||
@@ -121,7 +122,7 @@ class BOSMiner(BaseMiner):
|
||||
else:
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
|
||||
@@ -167,7 +168,7 @@ class BOSMiner(BaseMiner):
|
||||
|
||||
# if we get the version data, parse it
|
||||
if version_data:
|
||||
self.version = version_data.stdout.split("-")[5]
|
||||
self.version = version_data.split("-")[5]
|
||||
logging.debug(f"Found version for {self.ip}: {self.version}")
|
||||
return self.version
|
||||
|
||||
@@ -206,10 +207,6 @@ class BOSMiner(BaseMiner):
|
||||
offset = devs[0]["ID"]
|
||||
for board in devs:
|
||||
boards[board["ID"] - offset] = []
|
||||
if not board["Chips"] == self.nominal_chips:
|
||||
nominal = False
|
||||
else:
|
||||
nominal = True
|
||||
if not board["Chips"] == self.nominal_chips:
|
||||
nominal = False
|
||||
else:
|
||||
@@ -290,11 +287,11 @@ class BOSMiner(BaseMiner):
|
||||
board_map = {0: "left_board", 1: "center_board", 2: "right_board"}
|
||||
offset = temp[0]["ID"]
|
||||
for board in temp:
|
||||
id = board["ID"] - offset
|
||||
_id = board["ID"] - offset
|
||||
chip_temp = round(board["Chip"])
|
||||
board_temp = round(board["Board"])
|
||||
setattr(data, f"{board_map[id]}_chip_temp", chip_temp)
|
||||
setattr(data, f"{board_map[id]}_temp", board_temp)
|
||||
setattr(data, f"{board_map[_id]}_chip_temp", chip_temp)
|
||||
setattr(data, f"{board_map[_id]}_temp", board_temp)
|
||||
|
||||
if fans:
|
||||
fan_data = fans.get("FANS")
|
||||
@@ -363,9 +360,9 @@ class BOSMiner(BaseMiner):
|
||||
board_map = {0: "left_chips", 1: "center_chips", 2: "right_chips"}
|
||||
offset = boards[0]["ID"]
|
||||
for board in boards:
|
||||
id = board["ID"] - offset
|
||||
_id = board["ID"] - offset
|
||||
chips = board["Chips"]
|
||||
setattr(data, board_map[id], chips)
|
||||
setattr(data, board_map[_id], chips)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from miners import BaseMiner
|
||||
from API.bosminer import BOSMinerAPI
|
||||
import toml
|
||||
from config.bos import bos_config_convert, general_config_convert_bos
|
||||
import logging
|
||||
from settings import MINER_FACTORY_GET_VERSION_RETRIES as DATA_RETRIES
|
||||
|
||||
import asyncssh
|
||||
|
||||
from API.bosminer import BOSMinerAPI
|
||||
from miners import BaseMiner
|
||||
|
||||
|
||||
class BOSMinerOld(BaseMiner):
|
||||
def __init__(self, ip: str) -> None:
|
||||
|
||||
@@ -43,7 +43,7 @@ class BTMiner(BaseMiner):
|
||||
except APIError:
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
logging.warning(f"Failed to get hostname for miner: {self}")
|
||||
return "?"
|
||||
|
||||
@@ -141,11 +141,11 @@ class BTMiner(BaseMiner):
|
||||
|
||||
board_map = {0: "left_board", 1: "center_board", 2: "right_board"}
|
||||
for board in temp_data:
|
||||
id = board["ID"]
|
||||
_id = board["ID"]
|
||||
chip_temp = round(board["Chip Temp Avg"])
|
||||
board_temp = round(board["Temperature"])
|
||||
setattr(data, f"{board_map[id]}_chip_temp", chip_temp)
|
||||
setattr(data, f"{board_map[id]}_temp", board_temp)
|
||||
setattr(data, f"{board_map[_id]}_chip_temp", chip_temp)
|
||||
setattr(data, f"{board_map[_id]}_temp", board_temp)
|
||||
|
||||
if devs:
|
||||
boards = devs.get("DEVS")
|
||||
@@ -158,9 +158,9 @@ class BTMiner(BaseMiner):
|
||||
id_key = "ASC"
|
||||
offset = boards[0][id_key]
|
||||
for board in boards:
|
||||
id = board[id_key] - offset
|
||||
_id = board[id_key] - offset
|
||||
chips = board["Effective Chips"]
|
||||
setattr(data, board_map[id], chips)
|
||||
setattr(data, board_map[_id], chips)
|
||||
|
||||
if pools:
|
||||
pool_1 = None
|
||||
|
||||
@@ -19,6 +19,7 @@ class CGMiner(BaseMiner):
|
||||
self.api_type = "CGMiner"
|
||||
self.uname = "root"
|
||||
self.pwd = "admin"
|
||||
self.config = None
|
||||
|
||||
async def get_model(self):
|
||||
if self.model:
|
||||
|
||||
Reference in New Issue
Block a user