added bos get version

This commit is contained in:
UpstreamData
2022-04-01 13:33:05 -06:00
parent c57a523553
commit d84fcaafdf

View File

@@ -11,6 +11,7 @@ class BOSMiner(BaseMiner):
super().__init__(ip, api)
self.model = None
self.config = None
self.version = None
self.uname = "root"
self.pwd = "admin"
self.nominal_chips = 63
@@ -107,6 +108,18 @@ class BOSMiner(BaseMiner):
logging.warning(f"Failed to get model for miner: {self}")
return None
async def get_version(self):
if self.version:
logging.debug(f"Found version for {self.ip}: {self.version}")
return self.version
version_data = await self.send_ssh_command("cat /etc/bos_version")
if version_data:
self.version = version_data.stdout.split("-")[5]
logging.debug(f"Found version for {self.ip}: {self.version}")
return self.version
logging.warning(f"Failed to get model for miner: {self}")
return None
async def send_config(self, yaml_config) -> None:
"""Configures miner with yaml config."""
logging.debug(f"{self}: Sending config.")