fixed a bug with some BOS S17e not returning data frm devdetails and fans

This commit is contained in:
UpstreamData
2022-06-01 10:19:44 -06:00
parent ab964e4c88
commit 7cc7973587
2 changed files with 50 additions and 17 deletions

View File

@@ -28,6 +28,8 @@ from settings import (
NETWORK_PING_TIMEOUT as PING_TIMEOUT,
)
import asyncssh
AnyMiner = TypeVar("AnyMiner", bound=BaseMiner)
MINER_CLASSES = {
@@ -411,6 +413,20 @@ class MinerFactory(metaclass=Singleton):
elif "am2-s17" in version["STATUS"][0]["Description"]:
model = "Antminer S17"
# final try on a braiins OS bug with devdetails not returning
else:
async with asyncssh.connect(
str(ip),
known_hosts=None,
username="root",
password="admin",
server_host_key_algs=["ssh-rsa"],
) as conn:
cfg = await conn.run("bosminer config --data")
if cfg:
cfg = json.loads(cfg.stdout)
model = cfg.get("data").get("format").get("model")
if model:
# whatsminer have a V in their version string (M20SV41), remove everything after it
if "V" in model: