Add stealth mode GET/PUT endpoints to PrusaLink v1 API#5201
Open
xorza wants to merge 1 commit intoprusa3d:masterfrom
Open
Add stealth mode GET/PUT endpoints to PrusaLink v1 API#5201xorza wants to merge 1 commit intoprusa3d:masterfrom
xorza wants to merge 1 commit intoprusa3d:masterfrom
Conversation
Add /api/v1/settings/stealth endpoint to query and toggle stealth mode via PrusaLink. GET returns current state as JSON, PUT on/off enables or disables stealth mode by enqueueing M9150/M9140 G-codes.
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.
Summary
Add PrusaLink v1 API endpoints to query and toggle stealth mode remotely.
GET /api/v1/settings/stealth— returns{"enabled": bool}PUT /api/v1/settings/stealth/on— enables stealth mode (M9150)PUT /api/v1/settings/stealth/off— disables stealth mode (M9140)Follows existing patterns: inline handlers in anonymous namespace (like
stop_print/pause_print),EmptyRendererfor JSON response,marlin_client::gcode_try()for state change.3 files changed, 0 new files.
Closes #4044
Test plan
curl -H "X-Api-Key: KEY" http://PRINTER/api/v1/settings/stealthreturns correct statecurl -X PUT -H "X-Api-Key: KEY" http://PRINTER/api/v1/settings/stealth/onreturns 204 and enables stealthcurl -X PUT -H "X-Api-Key: KEY" http://PRINTER/api/v1/settings/stealth/offreturns 204 and disables stealth/settings/stealth/onreturns 404 (consistent with other v1 endpoints)/settings/stealth/invalidreturns 404