feature: add _get_wattage_limit for luxos
This commit is contained in:
committed by
Brett Rowan
parent
e86f2b62c5
commit
13a67dfdd1
@@ -47,6 +47,10 @@ LUXMINER_DATA_LOC = DataLocations(
|
|||||||
"_get_wattage",
|
"_get_wattage",
|
||||||
[RPCAPICommand("rpc_power", "power")],
|
[RPCAPICommand("rpc_power", "power")],
|
||||||
),
|
),
|
||||||
|
str(DataOptions.WATTAGE_LIMIT): DataFunction(
|
||||||
|
"_get_wattage_limit",
|
||||||
|
[],
|
||||||
|
),
|
||||||
str(DataOptions.FANS): DataFunction(
|
str(DataOptions.FANS): DataFunction(
|
||||||
"_get_fans",
|
"_get_fans",
|
||||||
[RPCAPICommand("rpc_fans", "fans")],
|
[RPCAPICommand("rpc_fans", "fans")],
|
||||||
@@ -289,6 +293,15 @@ class LUXMiner(LuxOSFirmware):
|
|||||||
except (LookupError, ValueError, TypeError):
|
except (LookupError, ValueError, TypeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def _get_wattage_limit(self) -> Optional[int]:
|
||||||
|
config = await self.get_config()
|
||||||
|
|
||||||
|
if config is not None:
|
||||||
|
try:
|
||||||
|
return int(config.mining_mode.active_preset.power)
|
||||||
|
except (LookupError, ValueError, TypeError):
|
||||||
|
pass
|
||||||
|
|
||||||
async def _get_fans(self, rpc_fans: dict = None) -> List[Fan]:
|
async def _get_fans(self, rpc_fans: dict = None) -> List[Fan]:
|
||||||
if rpc_fans is None:
|
if rpc_fans is None:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user