🐛 Fix NameError in AutoProductionRate sensor #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/c1-auto-production-rate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ComwattAutoProductionRateSensor.updateassignedself._attr_native_value = auto_production_rate— an undefined name — on every poll. Theexcept Exceptionbelow silently swallowed theNameErrorand triggered a full re-auth cycle every time the sensor updated.autoproductionRatesas a percentage.Side-effects
tests/test_sensor.py::test_auto_production_rate_reads_latest_valueis removed; the test now passes normally.F821entry in the ruff ignore list (which was only there for this specific NameError) is removed.Test plan
pytest tests/test_sensor.py— 6 passed locally (was 5 passed + 1 xfailed).ruff check .— still green withF821no longer ignored.