EV-56: a charger write that raises counts as a not-taken try #281

Merged
ems-agent merged 1 commits from EV-56 into release/1.0 2026-11-30 20:00:49 +01:00
Collaborator

EV-56 (brief v6, R3): a charger write that raises is now a not-taken try in Manual and Solar.

Fix (goodwe_controller/app/carmode.py)

  • ManualWriter._write catches an Exception from drv.write_current (never CancelledError) and returns False. Every caller counts it as a refused try: the normal write, a phase change's 0 A and close, the Off/shadow undo, and Solar's _put, _begin_solar and way-out 0 A. That gives RETRY_S spacing, MAX_TRIES and CHARGER_REFUSED.
  • The tracker is not told (Q2). The ERROR record "The car charger step failed" comes once per raised value, and is armed again by another value, a taken write, a user change or the charger's return (Q1, G2).
  • Shutdown writes (abandon, release) pass strict, so they behave as on the base (F3, H1, G3). The peak-cut path is EV-54's (G1).

Tests

  • New test_ev56.py covers T1-T29, T5b, T7c, T15d, T19b and T28b of reports/EV-56-test-plan.md. It is red on 344c974 and green here.
  • test_ev13.py T13: only fails == 0 changed, to fails == 1 (ruling Q2).
  • The mutants M1-M24 and M14b were each killed by the plan's rows.

Docs: one CHANGELOG line and DECISIONS/EV-56-raising-write.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w

EV-56 (brief v6, R3): a charger write that raises is now a not-taken try in Manual and Solar. **Fix** (`goodwe_controller/app/carmode.py`) - `ManualWriter._write` catches an `Exception` from `drv.write_current` (never `CancelledError`) and returns False. Every caller counts it as a refused try: the normal write, a phase change's 0 A and close, the Off/shadow undo, and Solar's `_put`, `_begin_solar` and way-out 0 A. That gives RETRY_S spacing, MAX_TRIES and CHARGER_REFUSED. - The tracker is not told (Q2). The ERROR record "The car charger step failed" comes once per raised value, and is armed again by another value, a taken write, a user change or the charger's return (Q1, G2). - Shutdown writes (`abandon`, `release`) pass `strict`, so they behave as on the base (F3, H1, G3). The peak-cut path is EV-54's (G1). **Tests** - New `test_ev56.py` covers T1-T29, T5b, T7c, T15d, T19b and T28b of reports/EV-56-test-plan.md. It is red on 344c974 and green here. - `test_ev13.py` T13: only `fails == 0` changed, to `fails == 1` (ruling Q2). - The mutants M1-M24 and M14b were each killed by the plan's rows. **Docs:** one CHANGELOG line and `DECISIONS/EV-56-raising-write.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-11-30 18:52:26 +01:00
EV-56: a charger write that raises counts as a not-taken try
checks / unit (pull_request) Successful in 57m33s
infra-pin / fresh (pull_request) Successful in 2s
3682b0754b
ManualWriter._write catches an Exception from drv.write_current (not CancelledError) and returns False, so every caller in Manual and Solar counts it as a refused try: RETRY_S spacing, MAX_TRIES, CHARGER_REFUSED. The tracker is not told (Q2). One ERROR record per raised value, armed again by another value, a taken write, a user change or the charger's return (Q1, G2). Shutdown writes (abandon, release) pass strict and keep base's behaviour (F3, H1, G3); the peak cut path keeps EV-54's (G1). test_ev13 T13: fails is 1 now (Q2). New test_ev56.py.

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent merged commit 1b909fb7bd into release/1.0 2026-11-30 20:00:49 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/goodwe-addon#281