feat(luxos): implement _is_mining using CurtailMode from config#412
Open
wilfredallyn wants to merge 1 commit intoUpstreamData:masterfrom
Open
feat(luxos): implement _is_mining using CurtailMode from config#412wilfredallyn wants to merge 1 commit intoUpstreamData:masterfrom
wilfredallyn wants to merge 1 commit intoUpstreamData:masterfrom
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MinerData.is_miningalways returnsTruefor LuxOS miners — even when the miner is in curtail sleep mode with 0 TH/s hashrate and PSU powered off.Root cause: The
LUXMinerbackend has no_is_mining()implementation. The base class returnsNone, andMinerData.is_miningdefaults toTrue, so the default is never overridden.This was discovered when writing an automated script to sleep/wake. The scheduler used
is_miningwhich was alwaysTrue.Solution
Add
_is_mining()toLUXMinerusing theCurtailModefield from the existingconfigRPC response. No new API calls needed —configis already fetched for MAC address, fault light, and wattage limit.LuxOS
CurtailModevalues (verified on hardware)_is_miningreturns"Sleep"False"WakeUp"TrueNoneTrueOther 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:DataOptions.IS_MININGtoLUXMINER_DATA_LOC, using existingrpc_configdata_is_mining()method: returnsFalsewhenCurtailMode == "Sleep",TrueotherwiseTesting
Verified against real S19K Pro running LuxOS
2026.2.11.043533in three states:CurtailMode: None,is_miningnow correctly returnsTruecurtail sleep) —CurtailMode: "Sleep",is_miningnow correctly returnsFalsecurtail wakeup) —CurtailMode: "WakeUp",is_miningreturnsTrue(boards are active, just ramping)Previously all three states returned
True.