Filament Ledger v2.4.0
Prints are charged from what the printer actually published
This release fixes filament being charged wrongly — or not at all — when a print finished.
What was happening. The per-tray figure was read from the printer's weight sensor at the single instant a print started or ended. Two measured facts made that a coin toss: the sensor is republished in bursts that alternate between carrying the per-tray breakdown and carrying none of it, and the print-started event arrives before the sensor holds the new job's figures. On the reference machine that produced a 937-layer print charged 2.1 g (the previous job's figure) and a 220-layer two-colour print charged nothing at all.
What it does now. The integration follows that sensor for the whole print and keeps the last reading that actually carried the per-tray breakdown. A print starting discards whatever preceded it, so no job can inherit its predecessor's figures, and a print ending is charged with what was published during its own run. If nothing was published, the job goes to the review queue instead of being charged a number nobody measured.
Restarting Home Assistant or changing a setting mid-print no longer loses the figure: in that case the number is read from the sensor directly, because the process that was not there for the start can trust what the sensor holds now.
Also in this release
- The Inventory tab no longer shows an unlabelled count. It was derived state — nothing to act on and no way to dismiss it — and the same figure is named in the summary card underneath (Needs weighing).
- A malformed figure from the printer can no longer raise inside Home Assistant's event loop.
Worth knowing
The figure is the planned weight from the slice, not a measurement — no printer weighs its filament. A finished print deducts automatically; correct it from the panel whenever it does not match, exactly as before.
After upgrading
Restart Home Assistant. No migration runs. Prints recorded before this release keep whatever they were charged; check anything that looks wrong against the printer's own history.