feature: add S19a Pro
This commit is contained in:
24
pyasic/miners/_types/antminer/X19/S19a_Pro.py
Normal file
24
pyasic/miners/_types/antminer/X19/S19a_Pro.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 S19aPro(BaseMiner): # noqa - ignore ABC method implementation
|
||||||
|
def __init__(self, ip: str):
|
||||||
|
super().__init__()
|
||||||
|
self.ip = ip
|
||||||
|
self.model = "S19a Pro"
|
||||||
|
self.nominal_chips = 100
|
||||||
|
self.fan_count = 4
|
||||||
@@ -16,6 +16,7 @@ from .S19 import S19
|
|||||||
from .S19_Pro import S19Pro
|
from .S19_Pro import S19Pro
|
||||||
from .S19_XP import S19XP
|
from .S19_XP import S19XP
|
||||||
from .S19a import S19a
|
from .S19a import S19a
|
||||||
|
from .S19a_Pro import S19aPro
|
||||||
from .S19j import S19j
|
from .S19j import S19j
|
||||||
from .S19j_Pro import S19jPro
|
from .S19j_Pro import S19jPro
|
||||||
from .T19 import T19
|
from .T19 import T19
|
||||||
|
|||||||
23
pyasic/miners/antminer/bmminer/X19/S19a_Pro.py
Normal file
23
pyasic/miners/antminer/bmminer/X19/S19a_Pro.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# 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._types import S19aPro # noqa - Ignore access to _module
|
||||||
|
|
||||||
|
from .X19 import BMMinerX19
|
||||||
|
|
||||||
|
|
||||||
|
class BMMinerS19aPro(BMMinerX19, S19aPro):
|
||||||
|
def __init__(self, ip: str) -> None:
|
||||||
|
super().__init__(ip)
|
||||||
|
self.ip = ip
|
||||||
@@ -139,7 +139,10 @@ class BMMinerX19(BMMiner):
|
|||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
data = await client.get(url, auth=auth)
|
data = await client.get(url, auth=auth)
|
||||||
if data:
|
if data:
|
||||||
data = data.json()
|
try:
|
||||||
|
data = data.json()
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
return []
|
||||||
if "SUMMARY" in data.keys():
|
if "SUMMARY" in data.keys():
|
||||||
if "status" in data["SUMMARY"][0].keys():
|
if "status" in data["SUMMARY"][0].keys():
|
||||||
for item in data["SUMMARY"][0]["status"]:
|
for item in data["SUMMARY"][0]["status"]:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from .S19 import BMMinerS19
|
|||||||
from .S19_Pro import BMMinerS19Pro
|
from .S19_Pro import BMMinerS19Pro
|
||||||
from .S19_XP import BMMinerS19XP
|
from .S19_XP import BMMinerS19XP
|
||||||
from .S19a import BMMinerS19a
|
from .S19a import BMMinerS19a
|
||||||
|
from .S19a_Pro import BMMinerS19aPro
|
||||||
from .S19j import BMMinerS19j
|
from .S19j import BMMinerS19j
|
||||||
from .S19j_Pro import BMMinerS19jPro
|
from .S19j_Pro import BMMinerS19jPro
|
||||||
from .T19 import BMMinerT19
|
from .T19 import BMMinerT19
|
||||||
|
|||||||
@@ -131,6 +131,10 @@ MINER_CLASSES = {
|
|||||||
"Default": BMMinerS19a,
|
"Default": BMMinerS19a,
|
||||||
"BMMiner": BMMinerS19a,
|
"BMMiner": BMMinerS19a,
|
||||||
},
|
},
|
||||||
|
"ANTMINER S19A PRO": {
|
||||||
|
"Default": BMMinerS19aPro,
|
||||||
|
"BMMiner": BMMinerS19aPro,
|
||||||
|
},
|
||||||
"ANTMINER T19": {
|
"ANTMINER T19": {
|
||||||
"Default": BMMinerT19,
|
"Default": BMMinerT19,
|
||||||
"BOSMiner+": BOSMinerT19,
|
"BOSMiner+": BOSMinerT19,
|
||||||
|
|||||||
Reference in New Issue
Block a user