added btminer get_model and improved return on the rest of the get_models

This commit is contained in:
UpstreamData
2022-01-07 10:20:55 -07:00
parent 8ec8c57e31
commit 4e8ff9ea74
9 changed files with 52 additions and 102 deletions

View File

@@ -5,11 +5,22 @@ from miners import BaseMiner
class BMMiner(BaseMiner):
def __init__(self, ip: str) -> None:
api = BMMinerAPI(ip)
self.model = None
super().__init__(ip, api)
def __repr__(self) -> str:
return f"BMMiner: {str(self.ip)}"
async def get_model(self):
if self.model:
return self.model
version_data = await self.api.devdetails()
if version_data:
self.model = version_data["DEVDETAILS"][0]["Model"].replace("Antminer ", "")
return self.model
return None
async def get_hostname(self) -> str:
return "BMMiner Unknown"