Skip to content

v2.1.0

Latest

Choose a tag to compare

@0jety0 0jety0 released this 06 Jun 17:53

✨ Features

  • Configurable request timeout — new number entity "Request timeout" (1–30 s, default 5 s), adjustable at runtime like the polling interval. The pump's embedded CGI server is slow/flaky over the LAN, so the default timeout is raised from 2 s to 5 s to avoid false timed out. Both the polling interval and the timeout are now adjustable from the UI so the pump is not overloaded.

🐛 Fixes

  • api: catch json.JSONDecodeError (non-JSON / empty body no longer raises an exception that stops polling); URL-encode the command key; keep the pump IP out of ERROR logs (moved to DEBUG).
  • coordinator: adjusting a local number (setpoint, dead band, steps, RPM, interval, timeout) no longer reloads the whole integration — cumulated energy and uptime are no longer reset. The update listener compares connection settings (host / switch / grid entity) instead of a flag: race-free, and applies options-flow edits live.
  • Enforced invariants: rpm_min_solar ≤ rpm_max_solar and dead_band_lower ≤ dead_band_upper (auto-clamped in the setters).
  • RunningStatus normalized via str() (works whether the pump returns "1" or 1).
  • Options flow: tolerates a None switch/grid entity; grid_power_entity falls back to entry.data.
  • sensor: a failed energy restore is now logged (warning) instead of being silently swallowed.

🔧 Refactor & quality

  • PumpStatus DTO (models.py): a single typed parse of the pump JSON.
  • SolarRegulator + SolarControllerConfig (solar.py): pure, testable proportional controller extracted from the coordinator (SRP).
  • number/sensor migrated to NumberEntityDescription / SensorEntityDescription (DRY).
  • GRID_POWER_STALENESS_SECONDS constant; IP/hostname validation in the config flow.
  • Removed utils.py; coordinator typed DataUpdateCoordinator[PumpStatus].

🛠️ Tooling & project

  • Migrated to uv + ruff: pyproject.toml (PEP 621) replaces Pipfile; ruff (lint + format) replaces black + isort; pytest config in pyproject; uv.lock committed. (Dev/CI tooling only — no impact on the Home Assistant runtime.)
  • GitHub Actions CI: ruff check + ruff format --check + pytest (via uv), in addition to hassfest and HACS validation.
  • License: PolyForm Noncommercial 1.0.0 (personal / non-commercial use).

✅ Tests

  • 43 pytest tests: API errors, solar P-controller, energy/uptime, reconfigure, RPM & dead-band invariants, options apply / connection-change, configurable timeout.
  • Pipfile removed in favor of pyproject.toml.

Full changelog: CHANGELOG.md