bug: handle cases where hashboards and fans can be None with unknown types

This commit is contained in:
Brett Rowan
2025-03-18 08:18:34 -06:00
parent 49f42172da
commit 6c46a7cd71
17 changed files with 102 additions and 1 deletions

View File

@@ -133,6 +133,9 @@ class BMMiner(StockFirmware):
pass
async def _get_hashboards(self, rpc_stats: dict = None) -> List[HashBoard]:
if self.expected_hashboards is None:
return []
hashboards = []
if rpc_stats is None:
@@ -202,6 +205,9 @@ class BMMiner(StockFirmware):
return hashboards
async def _get_fans(self, rpc_stats: dict = None) -> List[Fan]:
if self.expected_fans is None:
return []
if rpc_stats is None:
try:
rpc_stats = await self.rpc.stats()