add stop_mining and resume_mining for X19 devices
This commit is contained in:
@@ -299,6 +299,10 @@ class MinerConfig:
|
|||||||
self.temp_mode = "manual"
|
self.temp_mode = "manual"
|
||||||
if data.get("bitmain-fan-pwm"):
|
if data.get("bitmain-fan-pwm"):
|
||||||
self.fan_speed = int(data["bitmain-fan-pwm"])
|
self.fan_speed = int(data["bitmain-fan-pwm"])
|
||||||
|
elif key == "bitmain-work-mode":
|
||||||
|
if data[key]:
|
||||||
|
if data[key] == 1:
|
||||||
|
self.autotuning_wattage = 0
|
||||||
elif key == "fan_control":
|
elif key == "fan_control":
|
||||||
for _key in data[key].keys():
|
for _key in data[key].keys():
|
||||||
if _key == "min_fans":
|
if _key == "min_fans":
|
||||||
@@ -409,7 +413,10 @@ class MinerConfig:
|
|||||||
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
|
"pools": self.pool_groups[0].as_x19(user_suffix=user_suffix),
|
||||||
"bitmain-fan-ctrl": False,
|
"bitmain-fan-ctrl": False,
|
||||||
"bitmain-fan-pwn": 100,
|
"bitmain-fan-pwn": 100,
|
||||||
|
"miner-mode": 0, # Normal Mode
|
||||||
}
|
}
|
||||||
|
if self.autotuning_wattage == 0:
|
||||||
|
cfg["miner-mode"] = 1 # Sleep Mode
|
||||||
|
|
||||||
if not self.temp_mode == "auto":
|
if not self.temp_mode == "auto":
|
||||||
cfg["bitmain-fan-ctrl"] = True
|
cfg["bitmain-fan-ctrl"] = True
|
||||||
|
|||||||
@@ -146,3 +146,13 @@ class BMMinerX19(BMMiner):
|
|||||||
if not item["status"] == "s":
|
if not item["status"] == "s":
|
||||||
errors.append(X19Error(item["msg"]))
|
errors.append(X19Error(item["msg"]))
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
async def stop_mining(self) -> None:
|
||||||
|
cfg = await self.get_config()
|
||||||
|
cfg.autotuning_wattage = 0
|
||||||
|
await self.send_config(cfg)
|
||||||
|
|
||||||
|
async def resume_mining(self):
|
||||||
|
cfg = await self.get_config()
|
||||||
|
cfg.autotuning_wattage = 1
|
||||||
|
await self.send_config(cfg)
|
||||||
|
|||||||
Reference in New Issue
Block a user