diff --git a/pyasic/miners/miner_factory.py b/pyasic/miners/miner_factory.py index 422280f8..31f343b1 100644 --- a/pyasic/miners/miner_factory.py +++ b/pyasic/miners/miner_factory.py @@ -101,6 +101,8 @@ MINER_CLASSES = { "M20SV10": BTMinerM20SV10, "M20SV20": BTMinerM20SV20, "M20SV30": BTMinerM20SV30, + "M20PV10": BTMinerM20PV10, + "M20PV30": BTMinerM20PV30, "M20S+V30": BTMinerM20SPlusV30, "M21V10": BTMinerM21V10, "M21SV20": BTMinerM21SV20, diff --git a/pyasic/miners/types/whatsminer/M2X/M20P.py b/pyasic/miners/types/whatsminer/M2X/M20P.py new file mode 100644 index 00000000..87bc028d --- /dev/null +++ b/pyasic/miners/types/whatsminer/M2X/M20P.py @@ -0,0 +1,35 @@ +# ------------------------------------------------------------------------------ +# 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.makes import WhatsMiner + + +class M20PV10(WhatsMiner): # 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 = "M20P V10" + self.nominal_chips = 156 + self.fan_count = 2 + + +class M20PV30(WhatsMiner): # 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 = "M20P V30" + self.nominal_chips = 148 + self.fan_count = 2 diff --git a/pyasic/miners/types/whatsminer/M2X/M20S.py b/pyasic/miners/types/whatsminer/M2X/M20S.py index ebf65dd9..1f272e65 100644 --- a/pyasic/miners/types/whatsminer/M2X/M20S.py +++ b/pyasic/miners/types/whatsminer/M2X/M20S.py @@ -42,8 +42,5 @@ class M20SV30(WhatsMiner): # noqa - ignore ABC method implementation super().__init__(ip, api_ver) self.ip = ip self.model = "M20S V30" - self.nominal_chips = 0 - warnings.warn( - "Unknown chip count for miner type M20SV30, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)." - ) + self.nominal_chips = 140 self.fan_count = 2 diff --git a/pyasic/miners/types/whatsminer/M2X/__init__.py b/pyasic/miners/types/whatsminer/M2X/__init__.py index f8e94a24..5a1f2a8d 100644 --- a/pyasic/miners/types/whatsminer/M2X/__init__.py +++ b/pyasic/miners/types/whatsminer/M2X/__init__.py @@ -15,6 +15,7 @@ # ------------------------------------------------------------------------------ from .M20 import M20V10 +from .M20P import M20PV10, M20PV30 from .M20S import M20SV10, M20SV20, M20SV30 from .M20S_Plus import M20SPlusV30 from .M21 import M21V10 diff --git a/pyasic/miners/whatsminer/btminer/M2X/M20P.py b/pyasic/miners/whatsminer/btminer/M2X/M20P.py new file mode 100644 index 00000000..276f1493 --- /dev/null +++ b/pyasic/miners/whatsminer/btminer/M2X/M20P.py @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------------ +# 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 M2X +from pyasic.miners.types import M20PV10, M20PV30 + + +class BTMinerM20PV10(M2X, M20PV10): + pass + + +class BTMinerM20PV30(M2X, M20PV30): + pass diff --git a/pyasic/miners/whatsminer/btminer/M2X/__init__.py b/pyasic/miners/whatsminer/btminer/M2X/__init__.py index 6f3d33b5..976690e0 100644 --- a/pyasic/miners/whatsminer/btminer/M2X/__init__.py +++ b/pyasic/miners/whatsminer/btminer/M2X/__init__.py @@ -15,6 +15,7 @@ # ------------------------------------------------------------------------------ from .M20 import BTMinerM20V10 +from .M20P import BTMinerM20PV10, BTMinerM20PV30 from .M20S import BTMinerM20SV10, BTMinerM20SV20, BTMinerM20SV30 from .M20S_Plus import BTMinerM20SPlusV30 from .M21 import BTMinerM21V10