Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d91b7c4406 | ||
|
|
248a7e6d69 | ||
|
|
4f2c3e772a | ||
|
|
95f7146eef |
@@ -74,6 +74,24 @@ class VNish(BMMiner):
|
|||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
async def stop_mining(self) -> bool:
|
||||||
|
data = await self.web.stop_mining()
|
||||||
|
if data:
|
||||||
|
try:
|
||||||
|
return data["success"]
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
return False
|
||||||
|
|
||||||
|
async def resume_mining(self) -> bool:
|
||||||
|
data = await self.web.resume_mining()
|
||||||
|
if data:
|
||||||
|
try:
|
||||||
|
return data["success"]
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
return False
|
||||||
|
|
||||||
async def reboot(self) -> bool:
|
async def reboot(self) -> bool:
|
||||||
data = await self.web.reboot()
|
data = await self.web.reboot()
|
||||||
if data:
|
if data:
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ class MinerFactory:
|
|||||||
"location", ""
|
"location", ""
|
||||||
):
|
):
|
||||||
return MinerTypes.WHATSMINER
|
return MinerTypes.WHATSMINER
|
||||||
if "Braiins OS" in web_text or 'href="/cgi-bin/luci"' in web_text:
|
if "Braiins OS" in web_text:
|
||||||
return MinerTypes.BRAIINS_OS
|
return MinerTypes.BRAIINS_OS
|
||||||
if "cloud-box" in web_text:
|
if "cloud-box" in web_text:
|
||||||
return MinerTypes.GOLDSHELL
|
return MinerTypes.GOLDSHELL
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from pyasic.errors import APIWarning
|
|||||||
class BaseWebAPI(ABC):
|
class BaseWebAPI(ABC):
|
||||||
def __init__(self, ip: str) -> None:
|
def __init__(self, ip: str) -> None:
|
||||||
# ip address of the miner
|
# ip address of the miner
|
||||||
self.ip = ipaddress.ip_address(ip)
|
self.ip = ip # ipaddress.ip_address(ip)
|
||||||
self.username = "root"
|
self.username = "root"
|
||||||
self.pwd = "root"
|
self.pwd = "root"
|
||||||
|
|
||||||
|
|||||||
@@ -116,8 +116,32 @@ class VNishWebAPI(BaseWebAPI):
|
|||||||
async def reboot(self) -> dict:
|
async def reboot(self) -> dict:
|
||||||
return await self.send_command("system/reboot", post=True)
|
return await self.send_command("system/reboot", post=True)
|
||||||
|
|
||||||
|
async def pause_mining(self) -> dict:
|
||||||
|
return await self.send_command("mining/pause", post=True)
|
||||||
|
|
||||||
|
async def resume_mining(self) -> dict:
|
||||||
|
return await self.send_command("mining/resume", post=True)
|
||||||
|
|
||||||
|
async def stop_mining(self) -> dict:
|
||||||
|
return await self.send_command("mining/stop", post=True)
|
||||||
|
|
||||||
|
async def start_mining(self) -> dict:
|
||||||
|
return await self.send_command("mining/start", post=True)
|
||||||
|
|
||||||
async def info(self):
|
async def info(self):
|
||||||
return await self.send_command("info")
|
return await self.send_command("info")
|
||||||
|
|
||||||
async def summary(self):
|
async def summary(self):
|
||||||
return await self.send_command("summary")
|
return await self.send_command("summary")
|
||||||
|
|
||||||
|
async def chips(self):
|
||||||
|
return await self.send_command("chips")
|
||||||
|
|
||||||
|
async def layout(self):
|
||||||
|
return await self.send_command("layout")
|
||||||
|
|
||||||
|
async def status(self):
|
||||||
|
return await self.send_command("status")
|
||||||
|
|
||||||
|
async def settings(self):
|
||||||
|
return await self.send_command("settings")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyasic"
|
name = "pyasic"
|
||||||
version = "0.37.4"
|
version = "0.37.6"
|
||||||
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
description = "A set of modules for interfacing with many common types of ASIC bitcoin miners, using both their API and SSH."
|
||||||
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
authors = ["UpstreamData <brett@upstreamdata.ca>"]
|
||||||
repository = "https://github.com/UpstreamData/pyasic"
|
repository = "https://github.com/UpstreamData/pyasic"
|
||||||
|
|||||||
Reference in New Issue
Block a user