Skip to content

fix #8: poller delta-merge for persisted target temps#27

Merged
abe238 merged 1 commit into
mainfrom
fix/8-poller-delta-merge
May 26, 2026
Merged

fix #8: poller delta-merge for persisted target temps#27
abe238 merged 1 commit into
mainfrom
fix/8-poller-delta-merge

Conversation

@abe238
Copy link
Copy Markdown
Owner

@abe238 abe238 commented May 26, 2026

Closes #8. 10 new tests in tests/test_poller.py covering merge precedence, target persistence across delta updates, edge cases. 61 total passing.

The Bambu printer only re-publishes fields that *changed* in subsequent
MQTT report messages. nozzle_target_temper arrives in the initial pushall
and then never again until the user changes the target. The poller's
formatter was reading directly from each incoming payload, so subsequent
updates without the target field rendered 'nozzle 220/0'.

Fix: introduce merge_delta() that updates a long-lived snapshot dict,
skipping None and empty values so transiently missing fields don't blow
away known values. on_message merges into the snapshot and formats from it.

Closes #8.
@abe238 abe238 merged commit 816eb9e into main May 26, 2026
4 checks passed
@abe238 abe238 deleted the fix/8-poller-delta-merge branch May 26, 2026 08:48
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.

poll_status.py: cache last-known targets for delta updates

1 participant