feature: add S19i.

This commit is contained in:
UpstreamData
2023-09-19 13:56:40 -06:00
parent 4d21f150ce
commit 9f6235a0fc
7 changed files with 27 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ from pyasic.miners.types import (
S19XP,
S19a,
S19aPro,
S19i,
S19j,
S19jNoPIC,
S19jPro,
@@ -33,6 +34,10 @@ class BMMinerS19(AntminerModern, S19):
pass
class BMMinerS19i(AntminerModern, S19i):
pass
class BMMinerS19Pro(AntminerModern, S19Pro):
pass

View File

@@ -18,6 +18,7 @@ from .S19 import (
BMMinerS19,
BMMinerS19a,
BMMinerS19aPro,
BMMinerS19i,
BMMinerS19j,
BMMinerS19jNoPIC,
BMMinerS19jPro,

View File

@@ -239,14 +239,16 @@ class BMMiner(BaseMiner):
for i in range(board_offset, board_offset + 4):
try:
key = f'chain_acs{i}'
if boards[1].get(key, '') != '':
key = f"chain_acs{i}"
if boards[1].get(key, "") != "":
real_slots.append(i)
except LookupError:
pass
if len(real_slots) < 3:
real_slots = list(range(board_offset, board_offset + self.ideal_hashboards))
real_slots = list(
range(board_offset, board_offset + self.ideal_hashboards)
)
for i in real_slots:
hashboard = HashBoard(

View File

@@ -85,6 +85,7 @@ MINER_CLASSES = {
"ANTMINER S19L": BMMinerS19L,
"ANTMINER S19 PRO": BMMinerS19Pro,
"ANTMINER S19J": BMMinerS19j,
"ANTMINER S19I": BMMinerS19i,
"ANTMINER S19J88NOPIC": BMMinerS19jNoPIC,
"ANTMINER S19PRO+": BMMinerS19ProPlus,
"ANTMINER S19J PRO": BMMinerS19jPro,
@@ -777,11 +778,13 @@ class MinerFactory:
)
auth = auth_req.json()["jwt"]
web_data = (await session.post(
web_data = (
await session.post(
f"http://{ip}/api/type",
headers={"Authorization": "Bearer " + auth},
data={},
)).json()
)
).json()
return web_data["type"]
except (httpx.HTTPError, LookupError):
pass

View File

@@ -44,6 +44,15 @@ class S19Pro(AntMiner): # noqa - ignore ABC method implementation
self.fan_count = 4
class S19i(AntMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)
self.ip = ip
self.model = "S19i"
self.nominal_chips = 80
self.fan_count = 4
class S19ProPlus(AntMiner): # noqa - ignore ABC method implementation
def __init__(self, ip: str, api_ver: str = "0.0.0"):
super().__init__(ip, api_ver)

View File

@@ -20,6 +20,7 @@ from .S19 import (
S19XP,
S19a,
S19aPro,
S19i,
S19j,
S19jNoPIC,
S19jPro,

View File

@@ -24,7 +24,7 @@ from pyasic.errors import APIWarning
class BaseWebAPI(ABC):
def __init__(self, ip: str) -> None:
# ip address of the miner
self.ip = ip # ipaddress.ip_address(ip)
self.ip = ip # ipaddress.ip_address(ip)
self.username = "root"
self.pwd = "root"