feature: Finish fixing get and send config handlers for miners.

This commit is contained in:
Upstream Data
2023-12-10 10:14:57 -07:00
parent 9ee63cc3ab
commit 4fc57832e1

View File

@@ -38,16 +38,13 @@ class CGMinerT3HPlus(CGMiner, T3HPlus):
return False
async def get_config(self, api_pools: dict = None) -> MinerConfig:
if not api_pools:
try:
api_pools = await self.api.pools()
except APIError as e:
logging.warning(e)
# get pool data
try:
pools = await self.api.pools()
except APIError:
return self.config
if api_pools:
if "POOLS" in api_pools.keys():
cfg = MinerConfig().from_api(api_pools["POOLS"])
self.config = cfg
self.config = MinerConfig.from_api(pools)
return self.config
async def reboot(self) -> bool: