Compare commits

..

7 Commits

Author SHA1 Message Date
UpstreamData
934d469def version: bump version number. 2023-05-23 09:37:23 -06:00
UpstreamData
0c563ef538 bug: Fix bad type hinting on ABCMeta instead of type. 2023-05-23 09:36:50 -06:00
Upstream Data
ecc76d09af bug: add chip count for M32V10. 2023-05-21 19:38:37 -06:00
Upstream Data
caa66531b7 version: bump version number. 2023-05-21 16:56:52 -06:00
Upstream Data
23ea90b56f bug: add chip count for M31SVE10. 2023-05-21 16:56:28 -06:00
UpstreamData
9e2d3aeebd version: bump version number. 2023-05-16 16:09:17 -06:00
UpstreamData
0cead26872 feature: add support for S9j. 2023-05-16 16:08:49 -06:00
9 changed files with 58 additions and 18 deletions

View File

@@ -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.makes import AntMiner
class S9j(AntMiner): # 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 = "S9j"
self.nominal_chips = 63
self.fan_count = 2

View File

@@ -16,4 +16,5 @@
from .S9 import S9
from .S9i import S9i
from .S9j import S9j
from .T9 import T9

View File

@@ -120,10 +120,7 @@ class M31SVE10(WhatsMiner): # noqa - ignore ABC method implementation
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M31S VE10"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M31SVE10, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.nominal_chips = 70
self.fan_count = 2

View File

@@ -24,10 +24,7 @@ class M32V10(WhatsMiner): # noqa - ignore ABC method implementation
super().__init__(ip, api_ver)
self.ip = ip
self.model = "M32 V10"
self.nominal_chips = 0
warnings.warn(
"Unknown chip count for miner type M32V10, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
)
self.nominal_chips = 74
self.fan_count = 2

View 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 BMMiner
from pyasic.miners.btc._types import S9j # noqa - Ignore access to _module
class BMMinerS9j(BMMiner, S9j):
pass

View File

@@ -16,4 +16,5 @@
from .S9 import BMMinerS9
from .S9i import BMMinerS9i
from .S9j import BMMinerS9j
from .T9 import BMMinerT9

View File

@@ -18,8 +18,7 @@ import asyncio
import ipaddress
import json
import logging
from collections.abc import AsyncIterable
from typing import List, Tuple, Union
from typing import AsyncIterable, List, Tuple, Union
import asyncssh
import httpx
@@ -83,6 +82,10 @@ MINER_CLASSES = {
"Default": BMMinerS9i,
"BMMiner": BMMinerS9i,
},
"ANTMINER S9J": {
"Default": BMMinerS9j,
"BMMiner": BMMinerS9j,
},
"ANTMINER T9": {
"Default": BMMinerT9,
"BMMiner": BMMinerT9,

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyasic"
version = "0.33.12"
version = "0.33.15"
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
authors = ["UpstreamData <brett@upstreamdata.ca>"]
repository = "https://github.com/UpstreamData/pyasic"

View File

@@ -69,13 +69,6 @@ class NetworkTest(unittest.TestCase):
self.assertTrue(net_1 == correct_net)
self.assertTrue(net_2 == correct_net)
def test_net_len(self):
net = MinerNetwork("192.168.1.0", mask=32)
self.assertEqual(len(net), 1)
net2 = MinerNetwork("192.168.1.0", mask=31)
self.assertEqual(len(net2), 2)
def test_net_defaults(self):
net = MinerNetwork()
net_obj = net.get_network()