feat: cmd/low_spool MQTT handler#147
Merged
Merged
Conversation
Middleware or HA sends cmd/low_spool with "true"/"false" to start/stop LED breathing. Uses current LED target color (persists after tag removal) so breathing matches the last scanned spool. Also fixes misleading log message — shows "Spool X synced" instead of "Spool X, 0.0g remaining" when weight field is skipped.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR adds MQTT command handling for Changes
Sequence DiagramsequenceDiagram
participant MQTT as MQTT Broker
participant HAM as HomeAssistantManager
participant LED as LEDManager
participant Log as Logger
MQTT->>HAM: low_spool command<br/>(payload: "true"/"false")
HAM->>LED: getTargetColor(r, g, b)
LED-->>HAM: return RGB values
alt RGB all zero
HAM->>HAM: apply dim-white fallback<br/>(r=200, g=200, b=200)
end
alt payload == "true"
HAM->>LED: breatheFilamentColor()
HAM->>Log: log "Low spool enabled"
else payload != "true"
HAM->>LED: showFilamentColor(r, g, b)
HAM->>Log: log "Low spool disabled"
end
HAM->>MQTT: publish command response<br/>(success)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related Issues
Possibly Related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/low_spoolMQTT command — middleware/HA sendstrue/falseto start/stop LED breathing mid-printLEDManager::getTargetColor()getter for reading current LED target RGBTest plan
cmd/low_spool true→ breathes redcmd/low_spool false→ solid redCompletes #137 (gap #3 — cmd/low_spool handler)
Summary by CodeRabbit
New Features
Improvements