bug: fix wattage limit parsing on luxos
This commit is contained in:
@@ -421,7 +421,7 @@ class MiningModePreset(MinerConfigValue):
|
|||||||
) -> "MiningModePreset":
|
) -> "MiningModePreset":
|
||||||
active_preset = cls.get_active_preset_from_luxos(rpc_config, rpc_profiles)
|
active_preset = cls.get_active_preset_from_luxos(rpc_config, rpc_profiles)
|
||||||
return cls(
|
return cls(
|
||||||
active_preset=MiningPreset.from_luxos(active_preset),
|
active_preset=active_preset,
|
||||||
available_presets=[
|
available_presets=[
|
||||||
MiningPreset.from_luxos(p) for p in rpc_profiles["PROFILES"]
|
MiningPreset.from_luxos(p) for p in rpc_profiles["PROFILES"]
|
||||||
],
|
],
|
||||||
@@ -429,14 +429,14 @@ class MiningModePreset(MinerConfigValue):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_active_preset_from_luxos(
|
def get_active_preset_from_luxos(
|
||||||
cls, rpc_config: dict, rpc_profiles: list[dict]
|
cls, rpc_config: dict, rpc_profiles: dict
|
||||||
) -> dict:
|
) -> MiningPreset:
|
||||||
active_preset = None
|
active_preset = None
|
||||||
active_profile = rpc_config["CONFIG"][0]["Profile"]
|
active_profile = rpc_config["CONFIG"][0]["Profile"]
|
||||||
for profile in rpc_profiles["PROFILES"]:
|
for profile in rpc_profiles["PROFILES"]:
|
||||||
if profile["Profile Name"] == active_profile:
|
if profile["Profile Name"] == active_profile:
|
||||||
active_preset = profile
|
active_preset = profile
|
||||||
return active_preset
|
return MiningPreset.from_luxos(active_preset)
|
||||||
|
|
||||||
|
|
||||||
class ManualBoardSettings(MinerConfigValue):
|
class ManualBoardSettings(MinerConfigValue):
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class LUXMiner(LuxOSFirmware):
|
|||||||
rpc_profiles=data.get("profiles", [{}])[0],
|
rpc_profiles=data.get("profiles", [{}])[0],
|
||||||
)
|
)
|
||||||
|
|
||||||
async def upgrade_firmware(self) -> bool:
|
async def upgrade_firmware(self, *args, **kwargs) -> bool:
|
||||||
"""
|
"""
|
||||||
Upgrade the firmware on a LuxOS miner by calling the 'updaterun' API command.
|
Upgrade the firmware on a LuxOS miner by calling the 'updaterun' API command.
|
||||||
Returns:
|
Returns:
|
||||||
|
|||||||
Reference in New Issue
Block a user