Skip to content

feat(wui): Add dialog state to /api/v1/status + normal load/unload dialogs#5230

Open
packerlschupfer wants to merge 1 commit intoprusa3d:masterfrom
packerlschupfer:pr/dialog-status
Open

feat(wui): Add dialog state to /api/v1/status + normal load/unload dialogs#5230
packerlschupfer wants to merge 1 commit intoprusa3d:masterfrom
packerlschupfer:pr/dialog-status

Conversation

@packerlschupfer
Copy link
Copy Markdown

Summary

Expose active printer dialogs in the /api/v1/status response and implement the upstream TODO for normal filament load/unload dialog reporting.

Changes

  1. Dialog in status API: When the printer shows a dialog (filament prompt, crash recovery, warning), the status response includes a dialog object with the dialog ID, error code, and available button names.

  2. 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 dialog object 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

  • Trigger filament unload → dialog appears in status with "Stop" button
  • No dialog object when printer is idle
  • Crash recovery dialog shows correct buttons
  • Warning dialogs reported correctly

…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"}.
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