Skip to content

feat(luxos): implement _is_mining using CurtailMode from config#412

Open
wilfredallyn wants to merge 1 commit intoUpstreamData:masterfrom
wilfredallyn:feature/luxos-is-mining
Open

feat(luxos): implement _is_mining using CurtailMode from config#412
wilfredallyn wants to merge 1 commit intoUpstreamData:masterfrom
wilfredallyn:feature/luxos-is-mining

Conversation

@wilfredallyn
Copy link
Contributor

Problem

MinerData.is_mining always returns True for LuxOS miners — even when the miner is in curtail sleep mode with 0 TH/s hashrate and PSU powered off.

Root cause: The LUXMiner backend has no _is_mining() implementation. The base class returns None, and MinerData.is_mining defaults to True, so the default is never overridden.

This was discovered when writing an automated script to sleep/wake. The scheduler used is_mining which was always True.

Solution

Add _is_mining() to LUXMiner using the CurtailMode field from the existing config RPC response. No new API calls neededconfig is already fetched for MAC address, fault light, and wattage limit.

LuxOS CurtailMode values (verified on hardware)

CurtailMode Miner State _is_mining returns
"Sleep" Curtail sleep — boards off, PSU off, 0 TH/s False
"WakeUp" Ramping up from sleep True
None Running normally True

Other signals discovered (not used, but documented)

From config: IsPowerSupplyOn (False when sleeping)
From devs: Status ("Dead" when sleeping, "Alive" otherwise), IsRamping (True during wake ramp)

Changes

pyasic/miners/backends/luxminer.py:

  • Added DataOptions.IS_MINING to LUXMINER_DATA_LOC, using existing rpc_config data
  • Added _is_mining() method: returns False when CurtailMode == "Sleep", True otherwise

Testing

Verified against real S19K Pro running LuxOS 2026.2.11.043533 in three states:

  1. RunningCurtailMode: None, is_mining now correctly returns True
  2. Sleeping (after curtail sleep) — CurtailMode: "Sleep", is_mining now correctly returns False
  3. Waking (during ramp after curtail wakeup) — CurtailMode: "WakeUp", is_mining returns True (boards are active, just ramping)

Previously all three states returned True.

LuxOS miners had no _is_mining implementation, so MinerData.is_mining
always defaulted to True — even when the miner was in curtail sleep
mode with 0 hashrate and PSU off.

The LuxOS config API returns a CurtailMode field:
- 'Sleep': miner is in curtail sleep (boards off, PSU off)
- 'WakeUp': miner is ramping up from sleep
- None: miner is running normally

_is_mining now returns False when CurtailMode is 'Sleep',
True otherwise. Uses the existing rpc_config data (no additional
API calls needed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments