finished light functionality
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user