bug: fix T9+ support.
This commit is contained in:
@@ -29,7 +29,7 @@ from pyasic.miners.base import BaseMiner
|
|||||||
|
|
||||||
BMMINER_DATA_LOC = {
|
BMMINER_DATA_LOC = {
|
||||||
"mac": {"cmd": "get_mac", "kwargs": {}},
|
"mac": {"cmd": "get_mac", "kwargs": {}},
|
||||||
"model": {"cmd": "get_model", "kwargs": {"api_devdetails": {"api": "devdetails"}}},
|
"model": {"cmd": "get_model", "kwargs": {}},
|
||||||
"api_ver": {"cmd": "get_api_ver", "kwargs": {"api_version": {"api": "version"}}},
|
"api_ver": {"cmd": "get_api_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||||
"fw_ver": {"cmd": "get_fw_ver", "kwargs": {"api_version": {"api": "version"}}},
|
"fw_ver": {"cmd": "get_fw_ver", "kwargs": {"api_version": {"api": "version"}}},
|
||||||
"hostname": {"cmd": "get_hostname", "kwargs": {}},
|
"hostname": {"cmd": "get_hostname", "kwargs": {}},
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
# limitations under the License. -
|
# limitations under the License. -
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from pyasic.miners.backends import BMMiner
|
from pyasic.miners.backends import BMMiner
|
||||||
|
|
||||||
|
|
||||||
@@ -22,3 +24,6 @@ class Hiveon(BMMiner):
|
|||||||
super().__init__(ip, api_ver)
|
super().__init__(ip, api_ver)
|
||||||
# static data
|
# static data
|
||||||
self.api_type = "Hiveon"
|
self.api_type = "Hiveon"
|
||||||
|
|
||||||
|
async def get_model(self) -> Optional[str]:
|
||||||
|
return self.model + " (Hiveon)"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class VNish(BMMiner):
|
|||||||
# data gathering locations
|
# data gathering locations
|
||||||
self.data_locations = VNISH_DATA_LOC
|
self.data_locations = VNISH_DATA_LOC
|
||||||
|
|
||||||
async def get_model(self, api_stats: dict = None) -> Optional[str]:
|
async def get_model(self) -> Optional[str]:
|
||||||
return self.model + " (VNISH)"
|
return self.model + " (VNISH)"
|
||||||
|
|
||||||
async def restart_backend(self) -> bool:
|
async def restart_backend(self) -> bool:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class HiveonT9(Hiveon, T9):
|
|||||||
.upper()
|
.upper()
|
||||||
)
|
)
|
||||||
return mac
|
return mac
|
||||||
except (TypeError, ValueError, asyncssh.Error, OSError):
|
except (TypeError, ValueError, asyncssh.Error, OSError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def get_hashboards(self, api_stats: dict = None) -> List[HashBoard]:
|
async def get_hashboards(self, api_stats: dict = None) -> List[HashBoard]:
|
||||||
@@ -62,13 +62,17 @@ class HiveonT9(Hiveon, T9):
|
|||||||
try:
|
try:
|
||||||
hashboard.board_temp = api_stats["STATS"][1][f"temp{chipset}"]
|
hashboard.board_temp = api_stats["STATS"][1][f"temp{chipset}"]
|
||||||
hashboard.chip_temp = api_stats["STATS"][1][f"temp2_{chipset}"]
|
hashboard.chip_temp = api_stats["STATS"][1][f"temp2_{chipset}"]
|
||||||
hashrate += api_stats["STATS"][1][f"chain_rate{chipset}"]
|
|
||||||
chips += api_stats["STATS"][1][f"chain_acn{chipset}"]
|
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
hashboard.missing = False
|
hashboard.missing = False
|
||||||
hashboard.hashrate = hashrate
|
try:
|
||||||
|
hashrate += api_stats["STATS"][1][f"chain_rate{chipset}"]
|
||||||
|
chips += api_stats["STATS"][1][f"chain_acn{chipset}"]
|
||||||
|
print(chips)
|
||||||
|
except (KeyError, IndexError):
|
||||||
|
pass
|
||||||
|
hashboard.hashrate = round(hashrate / 1000, 2)
|
||||||
hashboard.chips = chips
|
hashboard.chips = chips
|
||||||
hashboards.append(hashboard)
|
hashboards.append(hashboard)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user