Repository navigation
Commit 707962d
fix(octopus): don't clear the car_charging_now streak on unknown, fix stale-anchor re-lapse
Three findings from Copilot's 2026-09-17 18:28 review on #5110, none
addressed by the prior midnight-rollover push (ba63fd9):
- get_car_charging_planned() treated any non-matching car_charging_now
value as a confirmed stop, including a transient HA "unknown"/
"unavailable" reading (e.g. around a restart). That could drop an
active streak's confirmation even though the car may have kept
charging throughout. Now uses the existing get_car_charging_now_tristate()
and only ends the streak on a real negative (tristate False); an
unknown reading falls through untouched, same as a guard-failing True.
- When a fresh confirming read re-anchored the streak in the same cycle
the *previous* anchor had already exceeded the rollover cap, the
cap-exceeded branch still ran against that now-superseded anchor and
immediately cleared the one this cycle just set - discarding the
fresh confirmation it was supposed to record. The lapse branch now
only fires when this cycle's own reading didn't already re-anchor.
- Added exclude_dynamic_io_slots() test coverage (fetch.py:1255 finding):
it was never called by any test, only rate_add_io_slots() directly,
leaving the feed-side io_adjusted stripping path - the one that
matters most on a real Intelligent tariff - unverified.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent ba63fd9 commit 707962d
3 files changed
Lines changed: 150 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2685 | 2685 | | |
2686 | 2686 | | |
2687 | 2687 | | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
2688 | 2695 | | |
2689 | 2696 | | |
2690 | 2697 | | |
2691 | | - | |
| 2698 | + | |
2692 | 2699 | | |
2693 | 2700 | | |
2694 | 2701 | | |
2695 | 2702 | | |
2696 | | - | |
| 2703 | + | |
| 2704 | + | |
2697 | 2705 | | |
2698 | 2706 | | |
2699 | 2707 | | |
2700 | 2708 | | |
2701 | 2709 | | |
2702 | 2710 | | |
2703 | | - | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
2704 | 2719 | | |
2705 | 2720 | | |
2706 | 2721 | | |
2707 | 2722 | | |
2708 | 2723 | | |
2709 | 2724 | | |
2710 | | - | |
| 2725 | + | |
2711 | 2726 | | |
2712 | 2727 | | |
2713 | 2728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
202 | 234 | | |
203 | 235 | | |
204 | 236 | | |
| |||
296 | 328 | | |
297 | 329 | | |
298 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
299 | 366 | | |
300 | 367 | | |
301 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
767 | 831 | | |
768 | 832 | | |
769 | 833 | | |
| |||
0 commit comments