feat(wui): Add dialog state to /api/v1/status + normal load/unload dialogs#5230
Open
packerlschupfer wants to merge 1 commit intoprusa3d:masterfrom
Open
feat(wui): Add dialog state to /api/v1/status + normal load/unload dialogs#5230packerlschupfer wants to merge 1 commit intoprusa3d:masterfrom
packerlschupfer wants to merge 1 commit intoprusa3d:masterfrom
Conversation
…alogs
Expose active printer dialogs in the /api/v1/status response, enabling
remote monitoring and response to printer prompts (filament operations,
crash recovery, warnings).
Status API change - when a dialog is active:
```json
{
"printer": { ... },
"dialog": {
"id": 12345,
"code": 31829,
"button0": "Stop",
"button1": "",
"button2": "",
"button3": ""
}
}
```
Also implements the upstream TODO in printer_state.cpp to expose
dialogs for normal (non-printing) filament load/unload operations.
Previously only load/unload dialogs during printing were reported.
Note: Dialog response functionality requires the /api/v1/control
endpoint (separate PR) with {"dialog_response": "Stop"}.
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
Expose active printer dialogs in the
/api/v1/statusresponse and implement the upstream TODO for normal filament load/unload dialog reporting.Changes
Dialog in status API: When the printer shows a dialog (filament prompt, crash recovery, warning), the status response includes a
dialogobject with the dialog ID, error code, and available button names.Normal load/unload dialogs (
printer_state.cpp): Implements the TODO at line 393 — dialogs for non-printing load/unload operations are now exposed with their available response buttons, not just while-printing ones.Response format
{ "printer": { "state": "BUSY", ... }, "dialog": { "id": 12345, "code": 31829, "button0": "Stop", "button1": "", "button2": "", "button3": "" } }The
dialogobject is only present when a dialog is active. Button fields are empty strings when not available.Motivation
This enables remote printer management tools (Home Assistant, custom dashboards) to detect and display printer dialogs. Combined with a control endpoint (separate PR #5228), this allows fully remote dialog response.
Test plan