Analysis: Calibration hardcodes pump_speed=100%, ignoring user speed requirements#427
Analysis: Calibration hardcodes pump_speed=100%, ignoring user speed requirements#427
Conversation
Co-authored-by: AndreWohnsland <50302161+AndreWohnsland@users.noreply.github.com>
Co-authored-by: AndreWohnsland <50302161+AndreWohnsland@users.noreply.github.com>
Co-authored-by: AndreWohnsland <50302161+AndreWohnsland@users.noreply.github.com>
Co-authored-by: AndreWohnsland <50302161+AndreWohnsland@users.noreply.github.com>
Co-authored-by: AndreWohnsland <50302161+AndreWohnsland@users.noreply.github.com>
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
|
|
@copilot i was more talking about PUMP_CONFIG which holds the volume flow and this was reported to not affect the time. The pump_speed is ingredient specific and should not be considered at the calibration, so this is intended. |
I've re-analyzed the code focusing on volume_flow = cfg.PUMP_CONFIG[ing.bottle - 1].volume_flow * ing.pump_speed / 100
flow_time = round(ing.amount / volume_flow, 1)Since
This SHOULD respect the
The only potential issue I see is that pin initialization happens once at startup in |



User reported calibration not respecting pump volume flow configuration. Root cause:
calibrate()function hardcodespump_speed=100, preventing testing at different speeds and causing inaccurate results for pumps running below full capacity.Bug Location
src/tabs/maker.py:151creates calibration ingredient with hardcoded speed:Impact
time = amount / (volume_flow * pump_speed / 100)pump_speed=100: Users cannot test at reduced speeds (e.g., 50%, 75%)Example
User's pump delivers 15 ml/s but configured as 30 ml/s:
100 / (30 * 100/100) = 3.33sAnalysis Artifacts
Recommended Fix
Add optional
pump_speedparameter (default=100 for backward compatibility):Requires corresponding UI/API updates to expose parameter.
Alternative: Document as Intended Behavior
If 100% speed is intentional for calibration, document this design decision and update UI to clarify "Testing at full configured speed (100%)".
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.