Repository navigation
fix(inverter): restore calculated capacity sensor after restart - #5283
springfall2008 merged 2 commits into
Conversation
|
Automated review failed to complete for this PR - see the triage bot's logs for details. The run exited cleanly but posted nothing, so the review step itself did not complete. Not retrying automatically; remove |
|
Thanks for checking. Since the code-quality check passed and the review bot exited without posting, could you share the relevant redacted log lines or what prevented the review from being posted? That would help us decide whether a retry is worthwhile. |
springfall2008
left a comment
There was a problem hiding this comment.
Automated review from the triage bot (/code-review high), posted manually by a maintainer because the bot's own posting step did not run.
Reviewed at head 7217c0df. The fix works for the #5222 scenario. After an HA restart, the periodic update_states() wipes state_data, the elif republishes via set_state (which also refreshes state_data), and the next cycle skips, matching the tests' second-cycle guard. No neighbouring tests in the shared fixture are disturbed.
Findings 1 and 2 are narrow real defects. Findings 3 and 4 are test-coverage and efficiency cleanups. Nothing was found in the removed-behaviour, cross-file or conventions passes.
|
Updated in a7d1246 for review points 1–3: the recovery path keeps the already-recorded planning mean (including all-None history), validates recorded history before calling the publisher so malformed entries cannot abort the inverter refresh, and tests that the None-today case does not republish on the next cycle. New regressions cover the all-None one-cycle scaling case and malformed history. With invalid history, the sensor is left missing rather than publishing corrupted data; planning still uses the recorded state. On point 4: the duplicate reads happen only on the missing-entity recovery cycle. Eliminating both cleanly would require passing cached state/history through or restructuring the publishing helper, so I kept this correctness fix narrow. Happy to consider a separate efficiency follow-up if useful. The isolated find_battery_size suite, applicable Python hooks and CSpell pass locally. The full quick suite is not validated in this environment because its secrets-loading test assumes no external Home Assistant secrets file. |
…-review's print fallback /code-review --comment prefers mcp__github_inline_comment__create_inline_comment and, when that tool is missing, says "fall back to gh api ... or print the findings instead". The bot never loads that tool (--strict-mcp-config), so every review lands on that sentence. PR springfall2008#5283's run took the print branch without attempting gh api at all, so nothing was denied and the existing "report a denial, don't print" rule never applied. The review was lost and the PR was marked BOT_FAILED. GH_API_ENDPOINT_FIRST_PROMPT now names the tool as absent and makes gh api the required path, allowing printing only after a gh api call has actually been denied. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…0-01 docs(debug-journal): fold in the 2026-10-01 queue slice (9 candidates); mark GH#5313 fixed by PR #5315, GH#5136 by PR #5293, GH#5222 by PR #5283, the iog-slot-io-adjusted row by PR #5304, GH#5068 reworked by PRs #5309/#5314; add the dynamic-load car cancel row and the GH#2649/#5302/#5324 findings
…); mark GH#5313 fixed by PR springfall2008#5315, GH#5136 by PR springfall2008#5293, GH#5222 by PR springfall2008#5283, the iog-slot-io-adjusted row by PR springfall2008#5304, GH#5068 reworked by PRs springfall2008#5309/springfall2008#5314; add the dynamic-load car cancel row and the GH#2649/springfall2008#5302/springfall2008#5324 findings Co-Authored-By: Claude Code <noreply@anthropic.com>
Fixes #5222.
After a restart,
battery_size_tracking()recovers today's measurement and trimmed mean from recorder history, but skips its only sensor-publishing branch. Re-publishsoc_max_calculatedfrom the recorded measurement only if the live entity is missing. A present entity is left alone, and the daily battery-size calculation is not rerun.Extend the existing restart regression test to assert that the sensor returns with its state and history and is not re-published on subsequent cycles. Add a case where today's recorded measurement is
None, preserving that failed day while restoring the sensor from earlier valid measurements.Validation:
./run_all --test find_battery_sizepassed with an isolated empty secrets file; targeted whitespace, encoding, Ruff and Black hooks passed. The full quick run could not be validated in this environment because its secrets-loading test assumes no external Home Assistant secrets file, while this container exposes one. The all-hooks run also hit npm EALLOWGIT initializing markdownlint; those unavailable Node hooks were skipped in the targeted Python hook run.