• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bramstroker / homeassistant-powercalc / 27899919076
100%

Build:
DEFAULT BRANCH: master
Ran 21 Jun 2026 09:22AM UTC
Jobs 1
Files 60
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Jun 2026 09:21AM UTC coverage: 99.972%. Remained the same
27899919076

push

github

web-flow
Retry on average measurements (#4223)

* feat: add retry logic to average power measurements

Previously, a single transient network error (e.g. Shelly plug timeout)
during take_average_measurement() would propagate up uncaught and abort
the entire measurement session. This was especially impactful during
effect measurements, which can take hours to complete.

The non-effect measurement path (take_measurement) already had robust
retry logic, but the average measurement path used by effects, speakers,
fans, and resistance measurements did not.

Changes:
- Wrap _take_average_measurement_reading() with try/except for
  PowerMeterError inside the sampling loop
- Track consecutive errors and only re-raise after exceeding
  max_retries (preserving fail-fast for persistent outages)
- Reset the consecutive error counter on each successful reading
- Log transient errors as warnings (not errors) with attempt counts
- Failed readings are simply skipped; the average is computed only
  from successful readings

This reuses the existing max_retries config value for consistency.

* Fix test_measure_util.py location to match source structure

* tests: patch time.time() to prevent infinite CPU loops in tests

* fix: add docstrings to empty process_answers stubs (SonarCloud)

* refactor: address PR review feedback

- Move time.sleep patch to autouse fixture in conftest.py
- Remove dedicated logging test; assert warnings in retry test via caplog
- Move import logging to top-level

---------

Co-authored-by: Guy Ellis <gellis@netpremacy.com>

7018 of 7020 relevant lines covered (99.97%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 27899919076.1 21 Jun 2026 09:22AM UTC 60
99.97
GitHub Action Run
Source Files on build 27899919076
  • Tree
  • List 60
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27899919076
  • fc8f6265 on github
  • Prev Build on master (#27899099855)
  • Next Build on master (#27900498949)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc