feature: add support for goldshell mode settings.
This commit is contained in:
@@ -50,6 +50,9 @@ class MiningModeNormal(MinerConfigValue):
|
|||||||
def as_epic(self) -> dict:
|
def as_epic(self) -> dict:
|
||||||
return {"ptune": {"enabled": False}}
|
return {"ptune": {"enabled": False}}
|
||||||
|
|
||||||
|
def as_goldshell(self) -> dict:
|
||||||
|
return {"settings": {"select": 0}}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MiningModeSleep(MinerConfigValue):
|
class MiningModeSleep(MinerConfigValue):
|
||||||
@@ -71,6 +74,9 @@ class MiningModeSleep(MinerConfigValue):
|
|||||||
def as_epic(self) -> dict:
|
def as_epic(self) -> dict:
|
||||||
return {"ptune": {"algo": "Sleep", "target": 0}}
|
return {"ptune": {"algo": "Sleep", "target": 0}}
|
||||||
|
|
||||||
|
def as_goldshell(self) -> dict:
|
||||||
|
return {"settings": {"select": 2}}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MiningModeLPM(MinerConfigValue):
|
class MiningModeLPM(MinerConfigValue):
|
||||||
@@ -89,6 +95,9 @@ class MiningModeLPM(MinerConfigValue):
|
|||||||
def as_auradine(self) -> dict:
|
def as_auradine(self) -> dict:
|
||||||
return {"mode": {"mode": "eco"}}
|
return {"mode": {"mode": "eco"}}
|
||||||
|
|
||||||
|
def as_goldshell(self) -> dict:
|
||||||
|
return {"settings": {"select": 1}}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MiningModeHPM(MinerConfigValue):
|
class MiningModeHPM(MinerConfigValue):
|
||||||
|
|||||||
@@ -96,13 +96,18 @@ class GoldshellMiner(BFGMiner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.config = config
|
self.config = config
|
||||||
|
cfg = config.as_goldshell(user_suffix=user_suffix)
|
||||||
# send them back 1 at a time
|
# send them back 1 at a time
|
||||||
for pool in config.as_goldshell(user_suffix=user_suffix)["pools"]:
|
for pool in cfg["pools"]:
|
||||||
await self.web.newpool(
|
await self.web.newpool(
|
||||||
url=pool["url"], user=pool["user"], password=pool["pass"]
|
url=pool["url"], user=pool["user"], password=pool["pass"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
settings = await self.web.setting()
|
||||||
|
for new_setting in cfg["settings"]:
|
||||||
|
settings[new_setting] = cfg["settings"][new_setting]
|
||||||
|
await self.web.set_setting(settings)
|
||||||
|
|
||||||
async def _get_mac(self, web_setting: dict = None) -> str:
|
async def _get_mac(self, web_setting: dict = None) -> str:
|
||||||
if web_setting is None:
|
if web_setting is None:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -138,5 +138,8 @@ class GoldshellWebAPI(BaseWebAPI):
|
|||||||
async def setting(self) -> dict:
|
async def setting(self) -> dict:
|
||||||
return await self.send_command("setting")
|
return await self.send_command("setting")
|
||||||
|
|
||||||
|
async def set_setting(self, values: dict):
|
||||||
|
await self.send_command("setting", **values)
|
||||||
|
|
||||||
async def status(self) -> dict:
|
async def status(self) -> dict:
|
||||||
return await self.send_command("status")
|
return await self.send_command("status")
|
||||||
|
|||||||
Reference in New Issue
Block a user