refactor: move ssh to miner.ssh

This commit is contained in:
upstreamdata
2024-01-18 15:32:09 -07:00
parent 3be3086a38
commit 4b5314a8f6
16 changed files with 155 additions and 110 deletions

View File

@@ -67,6 +67,7 @@ class BMMiner(BaseMiner):
"""Base handler for BMMiner based miners."""
_api_cls = BMMinerRPCAPI
api: BMMinerRPCAPI
data_locations = BMMINER_DATA_LOC
@@ -80,14 +81,6 @@ class BMMiner(BaseMiner):
self.config = MinerConfig.from_api(pools)
return self.config
async def reboot(self) -> bool:
logging.debug(f"{self}: Sending reboot command.")
ret = await self.send_ssh_command("reboot")
logging.debug(f"{self}: Reboot command completed.")
if ret is None:
return False
return True
##################################################
### DATA GATHERING FUNCTIONS (get_{some_data}) ###
##################################################
@@ -122,9 +115,6 @@ class BMMiner(BaseMiner):
return self.fw_ver
async def _get_hostname(self) -> Optional[str]:
hn = await self.send_ssh_command("cat /proc/sys/kernel/hostname")
return hn
async def _get_hashrate(self, api_summary: dict = None) -> Optional[float]:
# get hr from API