added reboot command for X19 and X17 models on BMMiner

This commit is contained in:
UpstreamData
2022-06-01 14:02:34 -06:00
parent a5195ff1db
commit 382f9cff76
13 changed files with 117 additions and 0 deletions

View File

@@ -46,3 +46,12 @@ class BMMinerS19a(BMMiner, S19a):
if data.get("code") == "B100":
return True
return False
async def reboot(self) -> bool:
url = f"http://{self.ip}/cgi-bin/reboot.cgi"
auth = httpx.DigestAuth("root", "root")
async with httpx.AsyncClient() as client:
data = await client.get(url, auth=auth)
if data.status_code == 200:
return True
return False