bug: fix MRO with vnish.
This commit is contained in:
22
pyasic/miners/antminer/vnish/X21/S21.py
Normal file
22
pyasic/miners/antminer/vnish/X21/S21.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 pyasic.miners.backends import VNish
|
||||||
|
from pyasic.miners.device.models import S21
|
||||||
|
|
||||||
|
|
||||||
|
class VNishS21(VNish, S21):
|
||||||
|
pass
|
||||||
17
pyasic/miners/antminer/vnish/X21/__init__.py
Normal file
17
pyasic/miners/antminer/vnish/X21/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 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 .S21 import VNishS21
|
||||||
@@ -18,3 +18,4 @@ from .X3 import *
|
|||||||
from .X7 import *
|
from .X7 import *
|
||||||
from .X17 import *
|
from .X17 import *
|
||||||
from .X19 import *
|
from .X19 import *
|
||||||
|
from .X21 import *
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ VNISH_DATA_LOC = DataLocations(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class VNish(BMMiner, VNishFirmware):
|
class VNish(VNishFirmware, BMMiner):
|
||||||
"""Handler for VNish miners"""
|
"""Handler for VNish miners"""
|
||||||
|
|
||||||
_web_cls = VNishWebAPI
|
_web_cls = VNishWebAPI
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ MINER_CLASSES = {
|
|||||||
"ANTMINER S19A": VNishS19a,
|
"ANTMINER S19A": VNishS19a,
|
||||||
"ANTMINER S19A PRO": VNishS19aPro,
|
"ANTMINER S19A PRO": VNishS19aPro,
|
||||||
"ANTMINER T19": VNishT19,
|
"ANTMINER T19": VNishT19,
|
||||||
|
"ANTMINER S21": VNishS21,
|
||||||
},
|
},
|
||||||
MinerTypes.EPIC: {
|
MinerTypes.EPIC: {
|
||||||
None: ePIC,
|
None: ePIC,
|
||||||
@@ -530,7 +531,6 @@ class MinerFactory:
|
|||||||
miner_type=miner_type,
|
miner_type=miner_type,
|
||||||
miner_model=miner_model,
|
miner_model=miner_model,
|
||||||
)
|
)
|
||||||
|
|
||||||
return miner
|
return miner
|
||||||
|
|
||||||
async def _get_miner_type(self, ip: str) -> MinerTypes | None:
|
async def _get_miner_type(self, ip: str) -> MinerTypes | None:
|
||||||
@@ -673,7 +673,7 @@ class MinerFactory:
|
|||||||
return MinerTypes.BRAIINS_OS
|
return MinerTypes.BRAIINS_OS
|
||||||
if "BTMINER" in upper_data or "BITMICRO" in upper_data:
|
if "BTMINER" in upper_data or "BITMICRO" in upper_data:
|
||||||
return MinerTypes.WHATSMINER
|
return MinerTypes.WHATSMINER
|
||||||
if "VNISH" in upper_data:
|
if "VNISH" in upper_data or "DEVICE PATH" in upper_data:
|
||||||
return MinerTypes.VNISH
|
return MinerTypes.VNISH
|
||||||
if "HIVEON" in upper_data:
|
if "HIVEON" in upper_data:
|
||||||
return MinerTypes.HIVEON
|
return MinerTypes.HIVEON
|
||||||
|
|||||||
Reference in New Issue
Block a user