Skip to content

Conversation

@Xento
Copy link
Owner

@Xento Xento commented Nov 29, 2025

Summary

  • add a dashboard streaming endpoint plus JSON API that reuse cached AMS data
  • broadcast MQTT-driven AMS updates to connected clients with versioned change detection
  • update the home page to subscribe to the stream, re-render trays in the browser, and show connection status with a fallback poller

Testing

  • python -m compileall app.py mqtt_bambulab.py

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +244 to +246
if "print" in data and "vt_tray" in data["print"]:
if data["print"]["vt_tray"] != LAST_AMS_CONFIG.get("vt_tray"):
LAST_AMS_CONFIG["vt_tray"] = data["print"]["vt_tray"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Change detection always dirty after dashboard render

The new change-detection guard compares incoming MQTT vt_tray/ams payloads to the cached LAST_AMS_CONFIG before bumping the dashboard version, but build_dashboard_payload mutates that same cache in place (see app.py lines 251‑264) by adding Spoolman enrichment fields. After any dashboard or /api/dashboard request, LAST_AMS_CONFIG no longer matches the raw telemetry, so this equality check always evaluates true and _increment_dashboard_version() fires on every MQTT report even when nothing changed. That means connected clients continuously rebuild the dashboard and refetch Spoolman data, generating unnecessary load and defeating the version gating intended here.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants