Created get_commands for each api

This commit is contained in:
UpstreamData
2021-10-07 15:55:27 -06:00
parent 0d12adf375
commit 4778aa957b
2 changed files with 6 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ class BaseMinerAPI:
self.port = port
self.ip = ipaddress.ip_address(ip)
def get_commands(self):
return [func for func in dir(self) if callable(getattr(self, func)) and not func.startswith("__") and func not in [func for func in dir(BaseMinerAPI) if callable(getattr(BaseMinerAPI, func))]]
async def multicommand(self, *commands: str) -> dict:
command = "+".join(commands)
return await self.send_command(command)