refactor: fix hashrate return typing.

This commit is contained in:
Brett Rowan
2024-06-28 08:35:27 -06:00
parent 30f385c2d9
commit 7a3c9a3460
16 changed files with 73 additions and 51 deletions

View File

@@ -109,7 +109,7 @@ class BMMiner(StockFirmware):
return self.fw_ver
async def _get_hashrate(self, rpc_summary: dict = None) -> Optional[float]:
async def _get_hashrate(self, rpc_summary: dict = None) -> Optional[AlgoHashRate]:
# get hr from API
if rpc_summary is None:
try:
@@ -223,7 +223,9 @@ class BMMiner(StockFirmware):
return fans
async def _get_expected_hashrate(self, rpc_stats: dict = None) -> Optional[float]:
async def _get_expected_hashrate(
self, rpc_stats: dict = None
) -> Optional[AlgoHashRate]:
# X19 method, not sure compatibility
if rpc_stats is None:
try: