Skip to content

Conversation

@jniebuhr
Copy link
Owner

@jniebuhr jniebuhr commented Oct 20, 2025

Summary by CodeRabbit

  • New Features
    • Added periodic diagnostic logging for pump operations, capturing power status, operating mode, control targets, current pressure, and flow measurements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

Added 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

Cohort / File(s) Summary
DimmedPump debug logging
lib/GaggiMateController/src/peripherals/DimmedPump.h, lib/GaggiMateController/src/peripherals/DimmedPump.cpp
Added private plot(uint8_t everyNth) method to periodically log pump telemetry (power, mode, pressure, flow) and private plotCount counter member; integrated logging call into loop method

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 whiskers twitching with delight

A plot method hops into view,
Logging numbers, fresh and true,
Every 150 hops we go,
Pressure, power, let it flow!
Debug data, bright and neat,
Makes our telemetry complete! 📊

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat: Add plot to dimmed pump to see numbers" is fully related to the changeset. The primary change is adding a new plot function to the DimmedPump class that logs various measurements (power, mode, targets, pressure, flow, and a counter) at periodic intervals. The title accurately captures this main change by indicating that plotting functionality is being added to the dimmed pump for the purpose of logging data. The phrasing is clear and specific enough that a teammate reviewing the commit history would understand that debugging/monitoring functionality is being introduced.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/selftest

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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:

  1. Log level: Using ESP_LOGI means this will log in production builds. Consider ESP_LOGV or ESP_LOGD instead, consistent with the similar Heater::plot() implementation (Heater.cpp:148).

  2. String allocation: Line 96 creates a String object which allocates on the heap. For embedded systems in a periodic loop, prefer const 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());
  1. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 35746de and 7c12343.

📒 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.

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.

2 participants