bug: fix some issues with epic send config.
This commit is contained in:
@@ -184,7 +184,7 @@ class MiningModePowerTune(MinerConfigValue):
|
||||
return {"mode": {"mode": "custom", "tune": "power", "power": self.power}}
|
||||
|
||||
def as_epic(self) -> dict:
|
||||
return {"ptune": {**self.algo.as_epic(), "target": self.power}}
|
||||
return {"ptune": {"algo": self.algo.as_epic(), "target": self.power}}
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -43,9 +43,9 @@ class TemperatureConfig(MinerConfigValue):
|
||||
def as_epic(self) -> dict:
|
||||
temps_config = {"temps": {}, "fans": {"Auto": {}}}
|
||||
if self.target is not None:
|
||||
temps_config["fans"]["Target Temperature"] = self.target
|
||||
temps_config["fans"]["Auto"]["Target Temperature"] = self.target
|
||||
else:
|
||||
temps_config["fans"]["Target Temperature"] = 60
|
||||
temps_config["fans"]["Auto"]["Target Temperature"] = 60
|
||||
if self.danger is not None:
|
||||
temps_config["temps"]["shutdown"] = self.danger
|
||||
return temps_config
|
||||
|
||||
@@ -116,13 +116,11 @@ class ePIC(BaseMiner):
|
||||
if not conf.get("temps", {}) == {}:
|
||||
await self.web.set_shutdown_temp(conf["temps"]["shutdown"])
|
||||
# Fans
|
||||
# set with sub-keys instead of conf["fans"] because sometimes both can be set
|
||||
if not conf["fans"].get("Manual", {}) == {}:
|
||||
await self.web.set_fan({"Manual": conf["fans"]["Manual"]})
|
||||
elif not conf["fans"].get("Auto", {}) == {}:
|
||||
target_temp = {"Target Temperature": conf["fans"]["Target Temperature"]}
|
||||
await self.web.set_fan(
|
||||
{"Auto": {**conf["fans"]["Auto"], **target_temp}}
|
||||
)
|
||||
await self.web.set_fan({"Auto": conf["fans"]["Auto"]})
|
||||
|
||||
# Mining Mode -- Need to handle that you may not be able to change while miner is tuning
|
||||
if conf["ptune"].get("enabled", True):
|
||||
|
||||
@@ -51,7 +51,7 @@ class ePICWebAPI(BaseWebAPI):
|
||||
f"http://{self.ip}:{self.port}/{command}",
|
||||
timeout=5,
|
||||
json={
|
||||
"param": parameters["parameters"],
|
||||
**parameters,
|
||||
"password": self.pwd,
|
||||
},
|
||||
)
|
||||
@@ -95,19 +95,19 @@ class ePICWebAPI(BaseWebAPI):
|
||||
return await self.send_command("reboot", privileged=True)
|
||||
|
||||
async def set_shutdown_temp(self, params: int) -> dict:
|
||||
return await self.send_command("shutdowntemp", parameters=params)
|
||||
return await self.send_command("shutdowntemp", param=params)
|
||||
|
||||
async def set_fan(self, params: dict) -> dict:
|
||||
return await self.send_command("fanspeed", parameters=params)
|
||||
return await self.send_command("fanspeed", param=params)
|
||||
|
||||
async def set_ptune_enable(self, params: bool) -> dict:
|
||||
return await self.send_command("perpetualtune", parameters=params)
|
||||
return await self.send_command("perpetualtune", param=params)
|
||||
|
||||
async def set_ptune_algo(self, params: dict) -> dict:
|
||||
return await self.send_command("perpetualtune/algo", parameters=params)
|
||||
return await self.send_command("perpetualtune/algo", param=params)
|
||||
|
||||
async def set_pools(self, params: dict) -> dict:
|
||||
return await self.send_command("coin", parameters=params)
|
||||
return await self.send_command("coin", param=params)
|
||||
|
||||
async def pause_mining(self) -> dict:
|
||||
return await self.send_command("miner", param="Stop")
|
||||
|
||||
Reference in New Issue
Block a user