Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions pyasic/miners/backends/luxminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
str(DataOptions.FAULT_LIGHT): DataFunction(
"_get_fault_light", [RPCAPICommand("rpc_config", "config")]
),
str(DataOptions.IS_MINING): DataFunction(
"_is_mining", [RPCAPICommand("rpc_config", "config")]
),
}
)

Expand Down Expand Up @@ -437,6 +440,21 @@ async def _get_fault_light(self, rpc_config: dict | None = None) -> bool | None:
pass
return None

async def _is_mining(self, rpc_config: dict | None = None) -> bool | None:
if rpc_config is None:
try:
rpc_config = await self.rpc.config()
except APIError:
pass

if rpc_config is not None:
try:
curtail_mode = rpc_config["CONFIG"][0].get("CurtailMode")
return curtail_mode != "Sleep"
except (LookupError, IndexError):
pass
return None

async def _get_pools(self, rpc_pools: dict | None = None) -> list[PoolMetrics]:
if rpc_pools is None:
try:
Expand Down