bug: fix possible missing models.

This commit is contained in:
UpstreamData
2023-06-12 12:41:50 -06:00
parent de5380715c
commit 0bc3bf20ee
3 changed files with 9 additions and 3 deletions

View File

@@ -370,7 +370,9 @@ class BOSMiner(BaseMiner):
return result.upper().strip()
async def get_model(self) -> Optional[str]:
return self.model + " (BOS)"
if self.model is not None:
return self.model + " (BOS)"
return "? (BOS)"
async def get_version(
self, api_version: dict = None, graphql_version: dict = None

View File

@@ -26,4 +26,6 @@ class Hiveon(BMMiner):
self.api_type = "Hiveon"
async def get_model(self) -> Optional[str]:
return self.model + " (Hiveon)"
if self.model is not None:
return self.model + " (Hiveon)"
return "? (Hiveon)"

View File

@@ -58,7 +58,9 @@ class VNish(BMMiner):
self.data_locations = VNISH_DATA_LOC
async def get_model(self) -> Optional[str]:
return self.model + " (VNISH)"
if self.model is not None:
return self.model + " (VNish)"
return "? (VNish)"
async def restart_backend(self) -> bool:
data = await self.web.restart_vnish()