bug: fix bosminer sometimes not being able to set config due to temp settings not being set.
This commit is contained in:
@@ -38,6 +38,8 @@ class TemperatureConfig(MinerConfigValue):
|
||||
temp_cfg["hot_temp"] = self.hot
|
||||
if self.danger is not None:
|
||||
temp_cfg["dangerous_temp"] = self.danger
|
||||
if len(temp_cfg) == 0:
|
||||
return {}
|
||||
return {"temp_control": temp_cfg}
|
||||
|
||||
def as_epic(self) -> dict:
|
||||
@@ -67,6 +69,7 @@ class TemperatureConfig(MinerConfigValue):
|
||||
hot=temp_control.get("hot_temp"),
|
||||
danger=temp_control.get("dangerous_temp"),
|
||||
)
|
||||
return cls()
|
||||
|
||||
@classmethod
|
||||
def from_epic(cls, web_conf: dict) -> "TemperatureConfig":
|
||||
|
||||
@@ -176,11 +176,14 @@ class BOSMiner(BaseMiner):
|
||||
self.config = cfg
|
||||
except toml.TomlDecodeError as e:
|
||||
raise APIError("Failed to decode toml when getting config.") from e
|
||||
except TypeError as e:
|
||||
raise APIError("Failed to decode toml when getting config.") from e
|
||||
|
||||
return self.config
|
||||
|
||||
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
||||
self.config = config
|
||||
print(config)
|
||||
parsed_cfg = config.as_bosminer(user_suffix=user_suffix)
|
||||
|
||||
toml_conf = toml.dumps(
|
||||
|
||||
Reference in New Issue
Block a user