Commit 4b704c0
Fix conservative overcurrent mode never reducing charger limit
Conservative mode clamped phase_limit at 0 (max(0, phase_limit + avail)),
returning a positive value that PowerAllocator read as surplus, so cuts
never fired and the charger was never throttled during overcurrent. Emit
the real negative deficit immediately instead, matching the
relative-availability contract used by the optimised/default balancers.
Conservative stays distinct from optimised by cutting right away rather
than waiting for cumulative trip risk to cross the threshold.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 562a392 commit 4b704c0
2 files changed
Lines changed: 27 additions & 6 deletions
File tree
- custom_components/evse_load_balancer/balancers
- tests/balancers
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | | - | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| |||
105 | 114 | | |
106 | 115 | | |
107 | 116 | | |
108 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
| |||
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
126 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
| |||
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
173 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
0 commit comments