bug: fix issues with bosminer multicommand, and update X17 to use BOSMiner instead of BOSer.
This commit is contained in:
@@ -70,13 +70,15 @@ class BOSerWebAPI(BaseWebAPI):
|
||||
not func.startswith("__") and not func.startswith("_")
|
||||
]
|
||||
|
||||
async def multicommand(self, *commands: str) -> dict:
|
||||
async def multicommand(
|
||||
self, *commands: str, ignore_errors: bool = False, allow_warning: bool = True
|
||||
) -> dict:
|
||||
result = {"multicommand": True}
|
||||
tasks = {}
|
||||
for command in commands:
|
||||
try:
|
||||
tasks[command] = asyncio.create_task(getattr(self, command)())
|
||||
except AttributeError:
|
||||
except (APIError, AttributeError):
|
||||
result["command"] = {}
|
||||
|
||||
await asyncio.gather(*list(tasks.values()))
|
||||
|
||||
@@ -59,10 +59,14 @@ class BOSMinerWebAPI(BaseWebAPI):
|
||||
return {}
|
||||
raise APIError(f"LUCI web command failed: command={command}")
|
||||
|
||||
async def multicommand(self, *commands: str) -> dict:
|
||||
async def multicommand(
|
||||
self, *commands: str, ignore_errors: bool = False, allow_warning: bool = True
|
||||
) -> dict:
|
||||
data = {}
|
||||
for command in commands:
|
||||
data[command] = await self.send_command(command, ignore_errors=True)
|
||||
data[command] = await self.send_command(
|
||||
command, ignore_errors=ignore_errors
|
||||
)
|
||||
return data
|
||||
|
||||
async def auth(self, session: httpx.AsyncClient) -> None:
|
||||
|
||||
Reference in New Issue
Block a user