Skip to content

Add stealth mode GET/PUT endpoints to PrusaLink v1 API#5201

Open
xorza wants to merge 1 commit intoprusa3d:masterfrom
xorza:feature/prusalink-stealth-mode
Open

Add stealth mode GET/PUT endpoints to PrusaLink v1 API#5201
xorza wants to merge 1 commit intoprusa3d:masterfrom
xorza:feature/prusalink-stealth-mode

Conversation

@xorza
Copy link
Copy Markdown

@xorza xorza commented Mar 24, 2026

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), EmptyRenderer for 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/stealth returns correct state
  • curl -X PUT -H "X-Api-Key: KEY" http://PRINTER/api/v1/settings/stealth/on returns 204 and enables stealth
  • curl -X PUT -H "X-Api-Key: KEY" http://PRINTER/api/v1/settings/stealth/off returns 204 and disables stealth
  • Stealth icon in printer header updates after API toggle
  • GET without API key returns 401
  • Wrong method to /settings/stealth/on returns 404 (consistent with other v1 endpoints)
  • GET to /settings/stealth/invalid returns 404

  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.
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.

[BFW-5710] [FEATURE REQUEST] Expose Stealth Mode controls via API

1 participant