improved bosminer get config
This commit is contained in:
@@ -8,13 +8,14 @@ class BOSminer(BaseMiner):
|
||||
def __init__(self, ip: str):
|
||||
api = BOSMinerAPI(ip)
|
||||
super().__init__(ip, api)
|
||||
self.config = {}
|
||||
|
||||
def __repr__(self):
|
||||
return f"BOSminer: {str(self.ip)}"
|
||||
|
||||
async def get_ssh_connection(self, username: str, password: str) -> asyncssh.connect:
|
||||
"""Create a new asyncssh connection"""
|
||||
conn = await asyncssh.connect(self.ip, known_hosts=None, username=username, password=password,
|
||||
conn = await asyncssh.connect(str(self.ip), known_hosts=None, username=username, password=password,
|
||||
server_host_key_algs=['ssh-rsa'])
|
||||
# return created connection
|
||||
return conn
|
||||
@@ -59,4 +60,5 @@ class BOSminer(BaseMiner):
|
||||
async with conn.start_sftp_client() as sftp:
|
||||
async with sftp.open('/etc/bosminer.toml') as file:
|
||||
toml_data = toml.loads(await file.read())
|
||||
self.config = toml_data
|
||||
return toml_data
|
||||
|
||||
@@ -15,7 +15,6 @@ class MinerFactory:
|
||||
if version_data:
|
||||
version = list(version_data['VERSION'][0].keys())
|
||||
if version:
|
||||
print(version_data)
|
||||
if "BOSminer" in version or "BOSminer+" in version:
|
||||
return BOSminer(str(ip))
|
||||
elif version == "CGMiner":
|
||||
|
||||
Reference in New Issue
Block a user