feature: Add AM modern send and get config.
This commit is contained in:
@@ -80,12 +80,12 @@ class AntminerModern(BMMiner):
|
|||||||
async def get_config(self) -> MinerConfig:
|
async def get_config(self) -> MinerConfig:
|
||||||
data = await self.web.get_miner_conf()
|
data = await self.web.get_miner_conf()
|
||||||
if data:
|
if data:
|
||||||
self.config = MinerConfig().from_raw(data)
|
self.config = MinerConfig.from_am_modern(data)
|
||||||
return self.config
|
return self.config
|
||||||
|
|
||||||
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
async def send_config(self, config: MinerConfig, user_suffix: str = None) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
conf = config.as_x19(user_suffix=user_suffix)
|
conf = config.as_am_modern(user_suffix=user_suffix)
|
||||||
data = await self.web.set_miner_conf(conf)
|
data = await self.web.set_miner_conf(conf)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
@@ -94,7 +94,7 @@ class AntminerModern(BMMiner):
|
|||||||
|
|
||||||
for i in range(7):
|
for i in range(7):
|
||||||
data = await self.get_config()
|
data = await self.get_config()
|
||||||
if data.as_x19() == conf:
|
if data.as_am_modern() == conf:
|
||||||
break
|
break
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user