feature: Add whatsminer send_config.

This commit is contained in:
Upstream Data
2023-12-10 09:55:05 -07:00
parent 468fba3465
commit b22b506d55

View File

@@ -199,10 +199,18 @@ class BTMiner(BaseMiner):
await self.api.update_pools(**pools_conf) await self.api.update_pools(**pools_conf)
except APIError: except APIError:
pass pass
try: try:
await self.api.adjust_power_limit(conf["wattage"]) if conf["mode"] == "normal":
await self.api.set_normal_power()
elif conf["mode"] == "high":
await self.api.set_high_power()
elif conf["mode"] == "low":
await self.api.set_low_power()
elif conf["mode"] == "power_tuning":
await self.api.adjust_power_limit(conf["power_tuning"]["wattage"])
except APIError: except APIError:
# cannot set wattage # cannot update, no API access usually
pass pass
async def get_config(self) -> MinerConfig: async def get_config(self) -> MinerConfig:
@@ -252,7 +260,8 @@ class BTMiner(BaseMiner):
return cfg return cfg
cfg.mining_mode = MiningModeConfig.power_tuning(power_lim) cfg.mining_mode = MiningModeConfig.power_tuning(power_lim)
return cfg self.config = cfg
return self.config