Skip to content

feat: ✨ support per-speed filtration pump power - #241

Draft
svasek wants to merge 2 commits into
mainfrom
feat/per-speed-pump-power
Draft

feat: ✨ support per-speed filtration pump power#241
svasek wants to merge 2 commits into
mainfrom
feat/per-speed-pump-power

Conversation

@svasek

@svasek svasek commented Jul 24, 2026

Copy link
Copy Markdown
Owner

✨ What

Add optional per-speed power values for variable-speed filtration pumps, so the energy estimate follows the running speed instead of a single fixed wattage.

Today a single filtration pump power option unlocks the power and energy sensors. This adds two optional overrides for the medium and low speeds, refining the estimate for pumps that run at different RPM depending on cover state or schedule.

🎯 Behaviour

The existing filtration pump power field keeps two roles:

  • master switch: 0 means no power or energy sensor is created (unchanged)
  • high-speed / base value: used whenever a per-speed override is not set
filtration pump power mid / low result
0 anything no power or energy sensor (as today)
set empty one value for every running speed (as today)
set set high uses the base, mid and low use their fields, an empty field falls back to the base

Power resolves from the reported filtration_speed_state each update: off is 0 W, a running speed picks its override when non-zero, otherwise the base value. The pump being off always yields 0 W.

Existing single-value setups behave exactly as before, so there is no options migration.

🛠️ Changes

  • const: add filtration_pump_power_mid and filtration_pump_power_low option keys
  • coordinator: new _compute_pump_power helper selects watts by running speed with fallback to the base value
  • config flow: two optional fields in the collapsed advanced section
  • strings and translations: labels and descriptions for the two fields, localised for cs, de, es, fr, it, pl
  • tests: parametrised coordinator tests covering base-only, per-speed override, zero-override fallback, high ignoring overrides, and the pump-off and base-disabled paths

🧪 Testing

  • pytest all pass (336 passed, 17 snapshots)
  • ✅ coverage 100% (coordinator, config_flow, const all 100%, no missing lines)
  • basedpyright 0 errors
  • ruff check and ruff format --check clean

📝 Notes

  • The mid and low fields are visible to every pump, gated only by wording ("Only affects variable-speed pumps") rather than a capability check, because the options schema is built statically. On a single-speed pump the running state is only high or off, so the overrides never apply.
  • The high speed is intentionally driven by the base value, so a single-speed pump and the top speed of a variable pump share one field.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aba6a42) to head (b74460a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #241   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1607      1622   +15     
=========================================
+ Hits          1607      1622   +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

- add optional mid and low watt overrides for variable-speed pumps in the
  collapsed advanced options section
- keep filtration_pump_power as the master switch and the high-speed value
- select power by filtration_speed_state each update: off is 0 W, an empty
  or zero mid/low override falls back to the base value
- leave existing single-value setups unchanged, so no options migration
- add and localise strings for the two new fields
- cover the selection logic with parametrised coordinator tests
@svasek
svasek force-pushed the feat/per-speed-pump-power branch from a6e1975 to 9ff8e89 Compare July 24, 2026 21:10
@svasek

svasek commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

/release-alpha

@github-actions

Copy link
Copy Markdown

🧪 Alpha pre-release created: 6.6.0-alpha.2

To install via HACS:

  1. In HACS, find NeoPool Modbus Integration in the integrations list
  2. Click ⋮ on that row → Redownload
  3. Pick version 6.6.0-alpha.2 from the version selector and install
  4. Restart Home Assistant

@svasek svasek changed the title feat(coordinator): ✨ support per-speed filtration pump power feat: ✨ support per-speed filtration pump power Jul 24, 2026
@svasek
svasek marked this pull request as draft July 28, 2026 10:17
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.

1 participant