added reboot command for X19 and X17 models on BMMiner
This commit is contained in:
@@ -60,3 +60,12 @@ class BMMinerS17(BMMiner, S17):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerS17Plus(BMMiner, S17Plus):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerS17Pro(BMMiner, S17Pro):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerS17e(BMMiner, S17e):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerT17(BMMiner, T17):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerT17Plus(BMMiner, T17Plus):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -60,3 +60,12 @@ class BMMinerT17e(BMMiner, T17e):
|
|||||||
if data["isBlinking"]:
|
if data["isBlinking"]:
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerS19(BMMiner, S19):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerS19Pro(BMMiner, S19Pro):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerS19a(BMMiner, S19a):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerS19j(BMMiner, S19j):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerS19jPro(BMMiner, S19jPro):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
@@ -46,3 +46,12 @@ class BMMinerT19(BMMiner, T19):
|
|||||||
if data.get("code") == "B100":
|
if data.get("code") == "B100":
|
||||||
return True
|
return True
|
||||||
return False
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user