add new critical temp api, add board serial no
This commit is contained in:
@@ -47,7 +47,9 @@ class TemperatureConfig(MinerConfigValue):
|
|||||||
else:
|
else:
|
||||||
temps_config["fans"]["Auto"]["Target Temperature"] = 60
|
temps_config["fans"]["Auto"]["Target Temperature"] = 60
|
||||||
if self.danger is not None:
|
if self.danger is not None:
|
||||||
temps_config["temps"]["shutdown"] = self.danger
|
temps_config["temps"]["critical"] = self.danger
|
||||||
|
if self.hot is not None:
|
||||||
|
temps_config["temps"]["shutdown"] = self.hot
|
||||||
return temps_config
|
return temps_config
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -71,16 +73,20 @@ class TemperatureConfig(MinerConfigValue):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_epic(cls, web_conf: dict) -> "TemperatureConfig":
|
def from_epic(cls, web_conf: dict) -> "TemperatureConfig":
|
||||||
try:
|
try:
|
||||||
dangerous_temp = web_conf["Misc"]["Shutdown Temp"]
|
dangerous_temp = web_conf["Misc"]["Critical Temp"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
dangerous_temp = None
|
dangerous_temp = None
|
||||||
|
try:
|
||||||
|
hot_temp = web_conf["Misc"]["Shutdown Temp"]
|
||||||
|
except KeyError:
|
||||||
|
hot_temp = None
|
||||||
# Need to do this in two blocks to avoid KeyError if one is missing
|
# Need to do this in two blocks to avoid KeyError if one is missing
|
||||||
try:
|
try:
|
||||||
target_temp = web_conf["Fans"]["Fan Mode"]["Auto"]["Target Temperature"]
|
target_temp = web_conf["Fans"]["Fan Mode"]["Auto"]["Target Temperature"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
target_temp = None
|
target_temp = None
|
||||||
|
|
||||||
return cls(target=target_temp, danger=dangerous_temp)
|
return cls(target=target_temp, hot=hot_temp, danger=dangerous_temp)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_vnish(cls, web_settings: dict) -> "TemperatureConfig":
|
def from_vnish(cls, web_settings: dict) -> "TemperatureConfig":
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class ePIC(BaseMiner):
|
|||||||
# Temps
|
# Temps
|
||||||
if not conf.get("temps", {}) == {}:
|
if not conf.get("temps", {}) == {}:
|
||||||
await self.web.set_shutdown_temp(conf["temps"]["shutdown"])
|
await self.web.set_shutdown_temp(conf["temps"]["shutdown"])
|
||||||
|
await self.web.set_critical_temp(conf["temps"]["critical"])
|
||||||
# Fans
|
# Fans
|
||||||
# set with sub-keys instead of conf["fans"] because sometimes both can be set
|
# set with sub-keys instead of conf["fans"] because sometimes both can be set
|
||||||
if not conf["fans"].get("Manual", {}) == {}:
|
if not conf["fans"].get("Manual", {}) == {}:
|
||||||
@@ -306,9 +307,20 @@ class ePIC(BaseMiner):
|
|||||||
HashBoard(slot=i, expected_chips=self.expected_chips)
|
HashBoard(slot=i, expected_chips=self.expected_chips)
|
||||||
for i in range(self.expected_hashboards)
|
for i in range(self.expected_hashboards)
|
||||||
]
|
]
|
||||||
|
if web_summary is not None and web_capabilities is not None:
|
||||||
if web_summary.get("HBs") is not None:
|
if web_summary.get("HBs") is not None:
|
||||||
for hb in web_summary["HBs"]:
|
for hb in web_summary["HBs"]:
|
||||||
num_of_chips = web_capabilities["Performance Estimator"]["Chip Count"]
|
if web_capabilities.get("Performance Estimator") is not None:
|
||||||
|
num_of_chips = web_capabilities["Performance Estimator"][
|
||||||
|
"Chip Count"
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
num_of_chips = self.expected_chips
|
||||||
|
if web_capabilities.get("Board Serial Numbers") is not None:
|
||||||
|
if hb["Index"] < len(web_capabilities["Board Serial Numbers"]):
|
||||||
|
hb_list[hb["Index"]].serial_number = web_capabilities[
|
||||||
|
"Board Serial Numbers"
|
||||||
|
][hb["Index"]]
|
||||||
hashrate = hb["Hashrate"][0]
|
hashrate = hb["Hashrate"][0]
|
||||||
# Update the Hashboard object
|
# Update the Hashboard object
|
||||||
hb_list[hb["Index"]].missing = False
|
hb_list[hb["Index"]].missing = False
|
||||||
|
|||||||
@@ -97,6 +97,9 @@ class ePICWebAPI(BaseWebAPI):
|
|||||||
async def set_shutdown_temp(self, params: int) -> dict:
|
async def set_shutdown_temp(self, params: int) -> dict:
|
||||||
return await self.send_command("shutdowntemp", param=params)
|
return await self.send_command("shutdowntemp", param=params)
|
||||||
|
|
||||||
|
async def set_critical_temp(self, params: int) -> dict:
|
||||||
|
return await self.send_command("criticaltemp", param=params)
|
||||||
|
|
||||||
async def set_fan(self, params: dict) -> dict:
|
async def set_fan(self, params: dict) -> dict:
|
||||||
return await self.send_command("fanspeed", param=params)
|
return await self.send_command("fanspeed", param=params)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user