Skip to content

feat: read temperature presets from Mainsail and Fluidd - #3

Merged
PyFlat-JR merged 1 commit into
mainfrom
feature/moonraker-presets
Nov 28, 2026
Merged

PyFlat-JR merged 1 commit into
mainfrom
feature/moonraker-presets

Conversation

@PyFlat-JR

Copy link
Copy Markdown
Member

What does this PR do?

Lets Preheat use temperature presets on Moonraker printers. Until now Moonraker always handed an empty preset list to the plugin, so the action only offered Cool down. A tester on a Klipper printer with Mainsail reported that preheating did not work.

  • Source: Klipper has no presets of its own. Mainsail and Fluidd keep theirs in Moonraker's database: Mainsail under mainsail / presets (one entry per preset in presets.<id>), Fluidd under fluidd / uiSettings in dashboard.tempPresets. Both are read with server.database.get_item together with the other settings (MoonrakerPresets).
  • Mapping: only heaters a preset enables (bool in Mainsail, active in Fluidd) are used, with their targets for extruder, heater_bed and the chamber (heater_generic chamber, or chamber as Fluidd names it). Temperature fan targets and Fluidd's unset value -1 are skipped. A preset without any usable target is left out.
  • Both interfaces: Mainsail's presets come first, sorted by name, then Fluidd's in their own order. A name already taken is not added a second time.
  • Missing database entries: a printer without Mainsail or Fluidd presets keeps an empty list. A refused or missing namespace is no error.
  • Limits: Moonraker sends no notification when a database entry changes, so a new preset shows up once the plugin connects again. A preset's own G-code is not run, only its targets.
  • Tests: FakeMoonraker now has a database. New tests cover both formats, the active flags, -1, fan entries, duplicate names and a printer without presets.
  • Docs: README (supported table, the Preheat row with where presets come from, Privacy) and a Moonraker rule in AGENTS.md.

Checklist

  • I have read AGENTS.md.
  • dotnet build and dotnet test pass locally (0 warnings, 190 tests).
  • I updated README.md / AGENTS.md if this changes what they describe.
  • If this touches a printer backend: I tested it against a real server (see below).

Printer/server tested against (if applicable)

Not yet on a real server. The storage format comes from the Mainsail and Fluidd sources (src/store/gui/presets and src/store/config). The tester with the Anycubic Kobra 2 on Klipper and Mainsail gets it next with a test build.

@PyFlat-JR
PyFlat-JR merged commit d925971 into main Nov 28, 2026
3 checks passed
@PyFlat-JR
PyFlat-JR deleted the feature/moonraker-presets branch November 28, 2026 11:32
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