Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e430b149b | ||
|
|
031dc534c7 | ||
|
|
ac9905717d | ||
|
|
ae835dbdb2 | ||
|
|
d59f29b582 | ||
|
|
c7d6f6cd9f | ||
|
|
bf19232ad9 |
@@ -46,6 +46,7 @@ class BaseMinerAPI:
|
||||
parameters: Union[str, int, bool] = None,
|
||||
ignore_errors: bool = False,
|
||||
allow_warning: bool = True,
|
||||
**kwargs
|
||||
) -> dict:
|
||||
"""Send an API command to the miner and return the result.
|
||||
|
||||
@@ -65,7 +66,7 @@ class BaseMinerAPI:
|
||||
else ""
|
||||
)
|
||||
# create the command
|
||||
cmd = {"command": command}
|
||||
cmd = {"command": command, **kwargs}
|
||||
if parameters:
|
||||
cmd["parameter"] = parameters
|
||||
|
||||
|
||||
@@ -549,15 +549,19 @@ class MinerConfig:
|
||||
cfg = {
|
||||
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
|
||||
"bitmain-fan-ctrl": False,
|
||||
"bitmain-fan-pwn": 100,
|
||||
"miner-mode": self.miner_mode.value,
|
||||
"bitmain-fan-pwn": "100",
|
||||
"miner-mode": str(self.miner_mode.value),
|
||||
"freq-level": "100"
|
||||
}
|
||||
|
||||
if not self.temp_mode == "auto":
|
||||
cfg["bitmain-fan-ctrl"] = True
|
||||
|
||||
if self.fan_speed:
|
||||
cfg["bitmain-fan-ctrl"] = str(self.fan_speed)
|
||||
cfg["bitmain-fan-pwn"] = str(self.fan_speed)
|
||||
|
||||
if self.miner_mode == X19PowerMode.Sleep:
|
||||
cfg["freq-level"] = "0"
|
||||
|
||||
return cfg
|
||||
|
||||
|
||||
@@ -69,7 +69,11 @@ class AntminerModern(BMMiner):
|
||||
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
||||
self.config = config
|
||||
conf = config.as_x19(user_suffix=user_suffix)
|
||||
await self.web.set_miner_conf(conf)
|
||||
data = await self.web.set_miner_conf(conf)
|
||||
|
||||
if data:
|
||||
if data.get("code") == "M000":
|
||||
return
|
||||
|
||||
for i in range(7):
|
||||
data = await self.get_config()
|
||||
|
||||
@@ -225,10 +225,7 @@ class M30SPlusPlusVH100(WhatsMiner): # noqa - ignore ABC method implementation
|
||||
super().__init__(ip, api_ver)
|
||||
self.ip = ip
|
||||
self.model = "M30S++ VH100"
|
||||
self.nominal_chips = 0
|
||||
warnings.warn(
|
||||
"Unknown chip count for miner type M30S++ VH100, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
|
||||
)
|
||||
self.nominal_chips = 82
|
||||
self.fan_count = 2
|
||||
|
||||
|
||||
|
||||
@@ -111,10 +111,7 @@ class M50VH80(WhatsMiner): # noqa - ignore ABC method implementation
|
||||
super().__init__(ip, api_ver)
|
||||
self.ip = ip
|
||||
self.model = "M50 VH80"
|
||||
self.nominal_chips = 0
|
||||
warnings.warn(
|
||||
"Unknown chip count for miner type M50 VH80, please open an issue on GitHub (https://github.com/UpstreamData/pyasic)."
|
||||
)
|
||||
self.nominal_chips = 111
|
||||
self.fan_count = 2
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class AntminerModernWebAPI(BaseWebAPI):
|
||||
async with httpx.AsyncClient() as client:
|
||||
if parameters:
|
||||
data = await client.post(
|
||||
url, data=json.dumps(parameters), auth=auth # noqa
|
||||
url, data=json.dumps(parameters), auth=auth, timeout=15 # noqa
|
||||
)
|
||||
else:
|
||||
data = await client.get(url, auth=auth)
|
||||
@@ -138,7 +138,7 @@ class AntminerOldWebAPI(BaseWebAPI):
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
if parameters:
|
||||
data = await client.post(url, data=parameters, auth=auth)
|
||||
data = await client.post(url, data=parameters, auth=auth, timeout=15)
|
||||
else:
|
||||
data = await client.get(url, auth=auth)
|
||||
except httpx.HTTPError:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pyasic"
|
||||
version = "0.33.6"
|
||||
version = "0.33.9"
|
||||
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>"]
|
||||
repository = "https://github.com/UpstreamData/pyasic"
|
||||
|
||||
Reference in New Issue
Block a user