feature: add mining mode preset option to config
This commit is contained in:
committed by
Brett Rowan
parent
97c20dae0a
commit
7f74b083d3
@@ -36,6 +36,7 @@ from pyasic.web.braiins_os.proto.braiins.bos.v1 import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from .algo import TunerAlgo, TunerAlgoType
|
from .algo import TunerAlgo, TunerAlgoType
|
||||||
|
from .presets import MiningPreset
|
||||||
from .scaling import ScalingConfig
|
from .scaling import ScalingConfig
|
||||||
|
|
||||||
|
|
||||||
@@ -344,6 +345,14 @@ class MiningModeHashrateTune(MinerConfigValue):
|
|||||||
return {"autotunerset": {"enabled": True}}
|
return {"autotunerset": {"enabled": True}}
|
||||||
|
|
||||||
|
|
||||||
|
class MiningModePreset(MinerConfigValue):
|
||||||
|
active_preset: MiningPreset
|
||||||
|
available_presets: list[MiningPreset] = field(default_factory=list)
|
||||||
|
|
||||||
|
def as_vnish(self) -> dict:
|
||||||
|
return {"overclock": {**self.active_preset.as_vnish()}}
|
||||||
|
|
||||||
|
|
||||||
class ManualBoardSettings(MinerConfigValue):
|
class ManualBoardSettings(MinerConfigValue):
|
||||||
freq: float
|
freq: float
|
||||||
volt: float
|
volt: float
|
||||||
@@ -444,6 +453,7 @@ class MiningModeConfig(MinerConfigOption):
|
|||||||
sleep = MiningModeSleep
|
sleep = MiningModeSleep
|
||||||
power_tuning = MiningModePowerTune
|
power_tuning = MiningModePowerTune
|
||||||
hashrate_tuning = MiningModeHashrateTune
|
hashrate_tuning = MiningModeHashrateTune
|
||||||
|
preset = MiningModePreset
|
||||||
manual = MiningModeManual
|
manual = MiningModeManual
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -673,5 +683,6 @@ MiningMode = TypeVar(
|
|||||||
MiningModeManual,
|
MiningModeManual,
|
||||||
MiningModePowerTune,
|
MiningModePowerTune,
|
||||||
MiningModeHashrateTune,
|
MiningModeHashrateTune,
|
||||||
|
MiningModePreset,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
14
pyasic/config/mining/presets.py
Normal file
14
pyasic/config/mining/presets.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from pyasic.config.base import MinerConfigValue
|
||||||
|
|
||||||
|
|
||||||
|
class MiningPreset(MinerConfigValue):
|
||||||
|
name: str | None = None
|
||||||
|
power: int | None = None
|
||||||
|
hashrate: int | None = None
|
||||||
|
tuned: bool | None = None
|
||||||
|
modded_psu: bool = False
|
||||||
|
|
||||||
|
def as_vnish(self) -> dict:
|
||||||
|
if self.name is not None:
|
||||||
|
return {"preset": self.name}
|
||||||
|
return {}
|
||||||
Reference in New Issue
Block a user