From 7964336a0c6d857f54feb01195732b0db0fbfa80 Mon Sep 17 00:00:00 2001
From: Adrian <33915735+cryptographicturk@users.noreply.github.com>
Date: Tue, 28 Jan 2025 08:36:15 -0800
Subject: [PATCH] feature: add support for S21 Hydro (#283)
---
docs/miners/antminer/X21.md | 13 +++++++++++++
docs/miners/supported_types.md | 1 +
pyasic/device/models.py | 1 +
pyasic/miners/antminer/bmminer/X21/S21.py | 6 +++++-
pyasic/miners/antminer/bmminer/X21/__init__.py | 2 +-
pyasic/miners/device/models/antminer/X21/S21.py | 7 +++++++
.../miners/device/models/antminer/X21/__init__.py | 2 +-
pyasic/miners/factory.py | 1 +
8 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/docs/miners/antminer/X21.md b/docs/miners/antminer/X21.md
index baa22b11..a6d76de4 100644
--- a/docs/miners/antminer/X21.md
+++ b/docs/miners/antminer/X21.md
@@ -14,6 +14,19 @@
show_root_heading: false
heading_level: 0
+## S21 Hydro (Stock)
+
+- [x] Shutdowns
+- [x] Power Modes
+- [ ] Setpoints
+- [ ] Presets
+
+::: pyasic.miners.antminer.bmminer.X21.S21.BMMinerS21Hydro
+ handler: python
+ options:
+ show_root_heading: false
+ heading_level: 0
+
## S21 Pro (Stock)
- [x] Shutdowns
diff --git a/docs/miners/supported_types.md b/docs/miners/supported_types.md
index 9d6d98d8..413686bb 100644
--- a/docs/miners/supported_types.md
+++ b/docs/miners/supported_types.md
@@ -105,6 +105,7 @@ details {
S21 (Stock)
S21 Pro (Stock)
T21 (Stock)
+ S21 Hydro (Stock)
diff --git a/pyasic/device/models.py b/pyasic/device/models.py
index 9886ab50..329c0c09 100644
--- a/pyasic/device/models.py
+++ b/pyasic/device/models.py
@@ -59,6 +59,7 @@ class AntminerModels(MinerModelType):
T19 = "T19"
S21 = "S21"
S21Pro = "S21 Pro"
+ S21Hydro = "S21 Hydro"
T21 = "T21"
def __str__(self):
diff --git a/pyasic/miners/antminer/bmminer/X21/S21.py b/pyasic/miners/antminer/bmminer/X21/S21.py
index 26dcc2b7..908670b5 100644
--- a/pyasic/miners/antminer/bmminer/X21/S21.py
+++ b/pyasic/miners/antminer/bmminer/X21/S21.py
@@ -15,7 +15,7 @@
# ------------------------------------------------------------------------------
from pyasic.miners.backends import AntminerModern
-from pyasic.miners.device.models import S21, S21Pro
+from pyasic.miners.device.models import S21, S21Hydro, S21Pro
class BMMinerS21(AntminerModern, S21):
@@ -24,3 +24,7 @@ class BMMinerS21(AntminerModern, S21):
class BMMinerS21Pro(AntminerModern, S21Pro):
pass
+
+
+class BMMinerS21Hydro(AntminerModern, S21Hydro):
+ pass
diff --git a/pyasic/miners/antminer/bmminer/X21/__init__.py b/pyasic/miners/antminer/bmminer/X21/__init__.py
index c9f78271..aae4f58f 100644
--- a/pyasic/miners/antminer/bmminer/X21/__init__.py
+++ b/pyasic/miners/antminer/bmminer/X21/__init__.py
@@ -13,5 +13,5 @@
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
-from .S21 import BMMinerS21, BMMinerS21Pro
+from .S21 import BMMinerS21, BMMinerS21Hydro, BMMinerS21Pro
from .T21 import BMMinerT21
diff --git a/pyasic/miners/device/models/antminer/X21/S21.py b/pyasic/miners/device/models/antminer/X21/S21.py
index 90f4acd7..b26cf1d1 100644
--- a/pyasic/miners/device/models/antminer/X21/S21.py
+++ b/pyasic/miners/device/models/antminer/X21/S21.py
@@ -34,3 +34,10 @@ class S21Pro(AntMinerMake):
expected_fans = 4
expected_hashboards = 3
algo = MinerAlgo.SHA256
+
+
+class S21Hydro(AntMinerMake):
+ raw_model = MinerModel.ANTMINER.S21Hydro
+ expected_chips = 216
+ expected_hashboards = 2
+ expected_fans = 0
diff --git a/pyasic/miners/device/models/antminer/X21/__init__.py b/pyasic/miners/device/models/antminer/X21/__init__.py
index ddf65ac8..f4b5d82c 100644
--- a/pyasic/miners/device/models/antminer/X21/__init__.py
+++ b/pyasic/miners/device/models/antminer/X21/__init__.py
@@ -14,5 +14,5 @@
# limitations under the License. -
# ------------------------------------------------------------------------------
-from .S21 import S21, S21Pro
+from .S21 import S21, S21Hydro, S21Pro
from .T21 import T21
diff --git a/pyasic/miners/factory.py b/pyasic/miners/factory.py
index 0d8d69f0..b8e8bf85 100644
--- a/pyasic/miners/factory.py
+++ b/pyasic/miners/factory.py
@@ -119,6 +119,7 @@ class MinerTypes(enum.Enum):
"ANTMINER BHB68606": BMMinerS21, # ???
"ANTMINER S21 PRO": BMMinerS21Pro,
"ANTMINER T21": BMMinerT21,
+ "ANTMINER S21 HYD.": BMMinerS21Hydro,
},
MinerTypes.WHATSMINER: {
None: type("WhatsminerUnknown", (BTMiner, WhatsMinerMake), {}),