Update data locations to be typed with dataclasses and enums. (#82)

* feature: swap AntminerModern to new data location style.

* bug: fix a bunch of missed instances of `nominal_` naming.

* feature: add support for S19 Pro Hydro.

* version: bump version number.

* dependencies: bump httpx version

* version: bump version number.

* feature: implement data locations for all remaining miners.

* refactor: remove some unused docstrings.

* feature: swap AntminerModern to new data location style.

* feature: implement data locations for all remaining miners.

* refactor: remove some unused docstrings.

* bug: fix misnamed data locations, and update base miner get_data to use new data locations.

* bug: fix include/exclude implementation on get_data.

* bug: swap ePIC to BaseMiner subclass.

* feature: add DataOptions to __all__

* tests: update data tests with new data locations method.

* bug: remove bad command from bosminer commands.

* dependencies: update dependencies.

* bug: fix some typing issues with python 3.8, and remove useless semaphore and scan threads.

* bug: fix KeyError when pools rpc command returns broken data.
This commit is contained in:
UpstreamData
2024-01-04 13:03:45 -07:00
committed by GitHub
parent 936474ed3b
commit 6e7442f90d
24 changed files with 861 additions and 984 deletions

View File

@@ -18,6 +18,7 @@ import inspect
import sys
import unittest
import warnings
from dataclasses import asdict
from pyasic.miners.backends import CGMiner # noqa
from pyasic.miners.base import BaseMiner
@@ -57,7 +58,6 @@ class MinersTest(unittest.TestCase):
"mac",
"model",
"expected_hashrate",
"pools",
"uptime",
"wattage",
"wattage_limit",
@@ -72,7 +72,9 @@ class MinersTest(unittest.TestCase):
miner_api=miner_api,
):
miner = MINER_CLASSES[miner_model][miner_api]("127.0.0.1")
miner_keys = sorted(list(miner.data_locations.keys()))
miner_keys = sorted(
[str(k) for k in asdict(miner.data_locations).keys()]
)
self.assertEqual(miner_keys, keys)