finished light functionality

This commit is contained in:
UpstreamData
2022-04-14 13:16:16 -06:00
parent 2d6891c6d2
commit 4776dce038
5 changed files with 329 additions and 300 deletions

View File

@@ -20,6 +20,7 @@ class BaseMiner:
self.api = api
self.api_type = None
self.model = None
self.light = None
async def _get_ssh_connection(self) -> asyncssh.connect:
"""Create a new asyncssh connection"""
@@ -56,6 +57,9 @@ class BaseMiner:
conn = self._get_ssh_connection()
await asyncssh.scp((conn, src), dest)
async def check_light(self):
return self.light
async def get_board_info(self):
return None

View File

@@ -40,12 +40,14 @@ class BOSMiner(BaseMiner):
async def fault_light_on(self) -> None:
"""Sends command to turn on fault light on the miner."""
logging.debug(f"{self}: Sending fault_light on command.")
self.light = True
await self.send_ssh_command("miner fault_light on")
logging.debug(f"{self}: fault_light on command completed.")
async def fault_light_off(self) -> None:
"""Sends command to turn off fault light on the miner."""
logging.debug(f"{self}: Sending fault_light off command.")
self.light = False
await self.send_ssh_command("miner fault_light off")
logging.debug(f"{self}: fault_light off command completed.")