fix: restore On Count and Pump Count sensors with long-term statistics - #37
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
The control reorganization (#33) replaced the raw On Count / Pump Count sensors with derived Total Run Time / Total Diffusion Time sensors under new unique_ids, which orphans the counter entities that issue #2's reporter (and anyone tracking device activity) relies on. Bring the raw counters back alongside the derived sensors with their original unique_ids, names, and units so existing registry entries, dashboards, and history resume seamlessly, and mark them TOTAL_INCREASING so Home Assistant records long-term statistics. The class that computes Total Diffusion Time is renamed to match what it now measures (entity-neutral; unique_ids derive from the type string). The underlying polling was already fixed in March (counts come from the v1 device list, which the coordinator merges on every poll); the counters move only when the device pushes data upstream, roughly daily. Closes #2 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21ce1d7 to
9ed6b04
Compare
Covers the configurable SSL bypass (#32), the Power/Fan control split and API reference (#33), schedule disarming after momentary runs (#35), the stale-poll shield (#36), the restored count sensors with long-term statistics (#37), and the MIT license adoption. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Closes #2 — restores the raw On Count and Pump Count sensors that today's control reorganization (#33) replaced, and enables long-term statistics on them.
Plan / write-up: https://plan.dalem.dev/p/gpnehhje
Context: where issue #2 actually stands
runCount/airPumpCount. The reporter confirmed on 2026-03-28 that the counts update (~daily). Perdocs/API.md, that daily-ish cadence is device-driven — the counters "only update when the device pushes data upstream on its own schedule — cannot be forced via API" — so it cannot be made faster from our side.Changes
AromaLinkOnCountSensorandAromaLinkPumpCountSensoralongside the derived time sensors (7 sensors per device), with the original unique_ids, names, units, and icons — existing entities, dashboards, automations, and recorded history resume seamlessly with identical values.state_class = TOTAL_INCREASING, so HA now records proper long-term statistics (the reporter's use case is tracking activity over days); device-side counter resets are handled gracefully by that state class.AromaLinkPumpCountSensorclass →AromaLinkTotalDiffusionTimeSensor(it computes diffusion time now, not a pump count). Internal-only: unique_ids derive from the sensor-type string, so no entity impact.docs/API.mdthat the web API'srunCount(surfaced by On Count) accumulates work seconds, not activations — the values have always been consistent; only the unit label is historical. Kept as-is deliberately: changing the unit would break statistics continuity for a cosmetic fix.Verification
Stubbed sensor tests, all passing: unique_ids match the pre-2.x registry format (
{user}_{device}_on_count/_pump_count); raw values pass through unscaled (1,569,411 / 8,531 from the docs' sample payload); derived sensors unchanged (435.95 h / 23.7 h);state_classpresent on the raw counters only; missing data returns None without crashing. All files compile; hassfest + HACS on this PR.Hardware test for @dalyem: after upgrading, On Count / Pump Count keep their entity_ids and prior magnitudes, and tick up when the device next pushes its report (~daily). Total Run Time / Total Diffusion Time continue alongside.
Rollback
Single revertable commit, sensor platform + README only.
🤖 Generated with Claude Code