Merge branch 'UpstreamData:master' into master
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pyasic.config import MinerConfig
|
||||
from pyasic.data import Fan, HashBoard
|
||||
from pyasic.data import AlgoHashRate, Fan, HashBoard, HashUnit
|
||||
from pyasic.data.error_codes import MinerErrorData, X19Error
|
||||
from pyasic.errors import APIError
|
||||
from pyasic.logger import logger
|
||||
from pyasic.miners.base import BaseMiner
|
||||
from pyasic.miners.data import DataFunction, DataLocations, DataOptions, WebAPICommand
|
||||
from pyasic.miners.device.firmware import ePICFirmware
|
||||
from pyasic.web.epic import ePICWebAPI
|
||||
|
||||
EPIC_DATA_LOC = DataLocations(
|
||||
@@ -86,14 +86,12 @@ EPIC_DATA_LOC = DataLocations(
|
||||
)
|
||||
|
||||
|
||||
class ePIC(BaseMiner):
|
||||
class ePIC(ePICFirmware):
|
||||
"""Handler for miners with the ePIC board"""
|
||||
|
||||
_web_cls = ePICWebAPI
|
||||
web: ePICWebAPI
|
||||
|
||||
firmware = "ePIC"
|
||||
|
||||
data_locations = EPIC_DATA_LOC
|
||||
|
||||
supports_shutdown = True
|
||||
@@ -248,7 +246,9 @@ class ePIC(BaseMiner):
|
||||
if web_summary["HBs"] is not None:
|
||||
for hb in web_summary["HBs"]:
|
||||
hashrate += hb["Hashrate"][0]
|
||||
return round(float(float(hashrate / 1000000)), 2)
|
||||
return AlgoHashRate.SHA256(hashrate, HashUnit.SHA256.MH).into(
|
||||
HashUnit.SHA256.TH
|
||||
)
|
||||
except (LookupError, ValueError, TypeError):
|
||||
pass
|
||||
|
||||
@@ -270,7 +270,9 @@ class ePIC(BaseMiner):
|
||||
ideal = hb["Hashrate"][1] / 100
|
||||
|
||||
hashrate += hb["Hashrate"][0] / ideal
|
||||
return round(float(float(hashrate / 1000000)), 2)
|
||||
return AlgoHashRate.SHA256(hashrate, HashUnit.SHA256.GH).int(
|
||||
self.algo.unit.default
|
||||
)
|
||||
except (LookupError, ValueError, TypeError):
|
||||
pass
|
||||
|
||||
@@ -342,7 +344,9 @@ class ePIC(BaseMiner):
|
||||
hashrate = hb["Hashrate"][0]
|
||||
# Update the Hashboard object
|
||||
hb_list[hb["Index"]].missing = False
|
||||
hb_list[hb["Index"]].hashrate = round(hashrate / 1000000, 2)
|
||||
hb_list[hb["Index"]].hashrate = AlgoHashRate.SHA256(
|
||||
hashrate, HashUnit.SHA256.MH
|
||||
).into(self.algo.unit.default)
|
||||
hb_list[hb["Index"]].chips = num_of_chips
|
||||
hb_list[hb["Index"]].temp = hb["Temperature"]
|
||||
return hb_list
|
||||
|
||||
Reference in New Issue
Block a user