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 return False
async def get_config(self, api_pools: dict = None) -> MinerConfig: async def get_config(self, api_pools: dict = None) -> MinerConfig:
if not api_pools: # get pool data
try: try:
api_pools = await self.api.pools() pools = await self.api.pools()
except APIError as e: except APIError:
logging.warning(e) return self.config
if api_pools: self.config = MinerConfig.from_api(pools)
if "POOLS" in api_pools.keys():
cfg = MinerConfig().from_api(api_pools["POOLS"])
self.config = cfg
return self.config return self.config
async def reboot(self) -> bool: async def reboot(self) -> bool: