-
-
Notifications
You must be signed in to change notification settings - Fork 99
feat: Add plot to dimmed pump to see numbers #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdded debug plotting functionality to the DimmedPump class. A new private method logs telemetry data (power, mode, control targets, pressure, flow) at periodic intervals controlled by an internal counter, triggered every 150 loop iterations. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 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 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lib/GaggiMateController/src/peripherals/DimmedPump.cpp (1)
93-108: Consider log level and avoid heap allocation for mode string.A few suggestions to improve this debug functionality:
Log level: Using
ESP_LOGImeans this will log in production builds. ConsiderESP_LOGVorESP_LOGDinstead, consistent with the similarHeater::plot()implementation (Heater.cpp:148).String allocation: Line 96 creates a
Stringobject which allocates on the heap. For embedded systems in a periodic loop, preferconst char*:- String mode = "POWER"; + const char* mode = "POWER"; if (_mode == ControlMode::PRESSURE) { mode = "PRESSURE"; } else if (_mode == ControlMode::FLOW) { mode = "FLOW"; } ESP_LOGI( LOG_TAG, "Dimmed Pump Plot: power=%.2f, mode=%s, ctrl_pressure=%.2f, ctrl_flow=%.2f, pressure=%.2f, flow=%.2f, counter=%ld", - _power, mode.c_str(), _ctrlPressure, _ctrlFlow, _currentPressure, _currentFlow, _psm.getCounter()); + _power, mode, _ctrlPressure, _ctrlFlow, _currentPressure, _currentFlow, _psm.getCounter());
- Style nitpick: Line 106-107 could use braces for consistency, though this matches the Heater pattern.
Based on learnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
lib/GaggiMateController/src/peripherals/DimmedPump.cpp(2 hunks)lib/GaggiMateController/src/peripherals/DimmedPump.h(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
lib/GaggiMateController/src/peripherals/DimmedPump.h (2)
lib/GaggiMateController/src/peripherals/DimmedPump.cpp (2)
plot(93-108)plot(93-93)lib/GaggiMateController/src/peripherals/Heater.cpp (2)
plot(146-152)plot(146-146)
lib/GaggiMateController/src/peripherals/DimmedPump.cpp (1)
lib/GaggiMateController/src/peripherals/Heater.cpp (2)
plot(146-152)plot(146-146)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: deploy
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (2)
lib/GaggiMateController/src/peripherals/DimmedPump.h (1)
35-35: LGTM! Clean declarations for debug plotting.The private method and counter member are appropriately declared for the periodic logging functionality.
Also applies to: 54-54
lib/GaggiMateController/src/peripherals/DimmedPump.cpp (1)
24-24: LGTM! Reasonable logging interval.Calling
plot(150)logs approximately every 4.5 seconds (150 iterations × 30ms), which is appropriate for debug telemetry.



Summary by CodeRabbit