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

@@ -225,7 +225,7 @@ class MaraMiner(MaraFirmware):
except LookupError:
pass
async def _get_hashrate(self, web_brief: dict = None) -> Optional[float]:
async def _get_hashrate(self, web_brief: dict = None) -> Optional[AlgoHashRate]:
if web_brief is None:
try:
web_brief = await self.web.brief()
@@ -271,7 +271,9 @@ class MaraMiner(MaraFirmware):
pass
return False
async def _get_expected_hashrate(self, web_brief: dict = None) -> Optional[float]:
async def _get_expected_hashrate(
self, web_brief: dict = None
) -> Optional[AlgoHashRate]:
if web_brief is None:
try:
web_brief = await self.web.brief()
@@ -288,7 +290,7 @@ class MaraMiner(MaraFirmware):
async def _get_wattage_limit(
self, web_miner_config: dict = None
) -> Optional[float]:
) -> Optional[AlgoHashRate]:
if web_miner_config is None:
try:
web_miner_config = await self.web.get_miner_config()