add sticker_hashrate for D10

This commit is contained in:
John-Paul Compagnone
2024-12-26 09:51:36 -05:00
committed by Brett Rowan
parent b903cc6e5f
commit 2019bdaff2
3 changed files with 8 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ class MinerData(BaseModel):
hostname: The network hostname of the miner as a str.
hashrate: The hashrate of the miner in TH/s as a float. Calculated automatically.
expected_hashrate: The factory nominal hashrate of the miner in TH/s as a float.
sticker_hashrate: The factory sticker hashrate of the miner as a float.
hashboards: A list of [`HashBoard`][pyasic.data.HashBoard]s on the miner with their statistics.
temperature_avg: The average temperature across the boards. Calculated automatically.
env_temp: The environment temps as a float.
@@ -90,6 +91,9 @@ class MinerData(BaseModel):
# hashrate
raw_hashrate: AlgoHashRateType = Field(exclude=True, default=None, repr=False)
# sticker
sticker_hashrate: AlgoHashRateType | None = None
# expected
expected_hashrate: AlgoHashRateType | None = None
expected_hashboards: int | None = None

View File

@@ -356,7 +356,9 @@ class BlackMiner(StockFirmware):
if rpc_stats is not None:
try:
expected_rate = self.expected_hashrate
expected_rate = rpc_stats["STATS"][1].get("total_rateideal")
if expected_rate is None:
expected_rate = self.sticker_hashrate
try:
rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError:

View File

@@ -3,5 +3,5 @@ from pyasic.miners.device.models import D10
class HammerD10(BlackMiner, D10):
expected_hashrate = 5000
sticker_hashrate = 5000
pass