Add in S19 XP spec, and also make an adjustment to BMMiner so it won't fail when hashboards are missing (#20)
* Add in spec for S19 XP * Adjust BMMiner to account for missing hashboards
This commit is contained in:
@@ -256,15 +256,26 @@ class BMMiner(BaseMiner):
|
||||
data.center_chips = boards[1].get(f"chain_acn{board_offset+1}")
|
||||
data.right_chips = boards[1].get(f"chain_acn{board_offset+2}")
|
||||
|
||||
data.left_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset}")) / 1000, 2
|
||||
)
|
||||
data.center_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset+1}")) / 1000, 2
|
||||
)
|
||||
data.right_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset+2}")) / 1000, 2
|
||||
)
|
||||
try:
|
||||
data.left_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset}")) / 1000, 2
|
||||
)
|
||||
except ValueError as e:
|
||||
data.left_board_hashrate = round(0.00, 2)
|
||||
try:
|
||||
data.center_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset+1}")) / 1000,
|
||||
2,
|
||||
)
|
||||
except ValueError as e:
|
||||
data.center_board_hashrate = round(0.00, 2)
|
||||
try:
|
||||
data.right_board_hashrate = round(
|
||||
float(boards[1].get(f"chain_rate{board_offset+2}")) / 1000,
|
||||
2,
|
||||
)
|
||||
except ValueError as e:
|
||||
data.right_board_hashrate = round(0.00, 2)
|
||||
|
||||
if stats:
|
||||
temp = stats.get("STATS")
|
||||
|
||||
24
pyasic/miners/_types/antminer/X19/S19_XP.py
Normal file
24
pyasic/miners/_types/antminer/X19/S19_XP.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2022 Upstream Data Inc
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from pyasic.miners.base import BaseMiner
|
||||
|
||||
|
||||
class S19XP(BaseMiner):
|
||||
def __init__(self, ip: str):
|
||||
super().__init__()
|
||||
self.ip = ip
|
||||
self.model = "S19 XP"
|
||||
self.nominal_chips = 110
|
||||
self.fan_count = 4
|
||||
@@ -18,6 +18,8 @@ from .S19_Pro import S19Pro
|
||||
from .S19j import S19j
|
||||
from .S19j_Pro import S19jPro
|
||||
|
||||
from .S19_XP import S19XP
|
||||
|
||||
from .S19a import S19a
|
||||
|
||||
from .T19 import T19
|
||||
|
||||
22
pyasic/miners/antminer/bmminer/X19/S19_XP.py
Normal file
22
pyasic/miners/antminer/bmminer/X19/S19_XP.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2022 Upstream Data Inc
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from .X19 import BMMinerX19
|
||||
from pyasic.miners._types import S19XP # noqa - Ignore access to _module
|
||||
|
||||
|
||||
class BMMinerS19XP(BMMinerX19, S19XP):
|
||||
def __init__(self, ip: str) -> None:
|
||||
super().__init__(ip)
|
||||
self.ip = ip
|
||||
@@ -18,6 +18,8 @@ from .S19_Pro import BMMinerS19Pro
|
||||
from .S19j import BMMinerS19j
|
||||
from .S19j_Pro import BMMinerS19jPro
|
||||
|
||||
from .S19_XP import BMMinerS19XP
|
||||
|
||||
from .S19a import BMMinerS19a
|
||||
|
||||
from .T19 import BMMinerT19
|
||||
|
||||
@@ -129,6 +129,10 @@ MINER_CLASSES = {
|
||||
"BMMiner": BMMinerS19jPro,
|
||||
"CGMiner": CGMinerS19jPro,
|
||||
},
|
||||
"ANTMINER S19 XP": {
|
||||
"Default": BMMinerS19XP,
|
||||
"BMMiner": BMMinerS19XP,
|
||||
},
|
||||
"ANTMINER S19A": {
|
||||
"Default": BMMinerS19a,
|
||||
"BMMiner": BMMinerS19a,
|
||||
|
||||
Reference in New Issue
Block a user