feature: add set_static_ip and set_dhcp for bosminer.

This commit is contained in:
UpstreamData
2023-06-27 14:55:05 -06:00
parent 666b9dfe94
commit 0b27400d27
3 changed files with 50 additions and 5 deletions

View File

@@ -58,11 +58,13 @@ class BOSMinerWebAPI(BaseWebAPI):
command: dict,
) -> dict:
url = f"http://{self.ip}/graphql"
query = self.parse_command(command)
query = command
if command.get("query") is None:
query = {"query": self.parse_command(command)}
try:
async with httpx.AsyncClient() as client:
await self.auth(client)
data = await client.post(url, json={"query": query})
data = await client.post(url, json=query)
except httpx.HTTPError:
pass
else: