Repository navigation
Commit 2eb3466
feat(car): raise the maximum supported cars from 4 to 8 (#4545)
* feat(car): raise the maximum supported cars from 4 to 8
Some users have more than 4 EVs/chargers registered (e.g. multiple Octopus
Intelligent devices), which the previous 4-car ceiling (CONFIG_ITEMS entities,
KERNEL_MAX_CARS) rejected outright by clamping num_cars down. Doubling the
limit to 8 needs three things kept in lockstep: the shared PREDBAT_MAX_CARS
constant, the C++ kernel's PK_MAX_CARS array size (with PK_PARITY_REVISION/
KERNEL_PARITY_REVISION bumped 5 -> 6, on top of the ABI 4 already on main,
so a stale 4-car binary is safely rejected rather than corrupting the ctypes
struct layout), and the matching ctypes.Structure array sizes on the Python
side (previously hardcoded to 4 independently of KERNEL_MAX_CARS - this
mismatch caused a segfault before the fix).
- const.py: PREDBAT_MAX_CARS 4 -> 8
- prediction_kernel.cpp / .py: PK_MAX_CARS/KERNEL_MAX_CARS -> 8, parity
revision bumped 5 -> 6, ctypes array fields now reference KERNEL_MAX_CARS
instead of a hardcoded 4 (car_charging_limit, car_charging_soc, car_soc_next)
- config.py: added car_charging_rate_4..7 and car_charging_manual_soc(_kwh)_4..7
CONFIG_ITEMS entries so cars 4-7 have HA entities to configure
- Regression tests for the new ceiling: kernel parity, 8-car config
resolution via the real config_index, MockConfigProvider car rate defaults,
and reset_inverter's car_charging_limit/soc arrays sized from
PREDBAT_MAX_CARS instead of a hardcoded 4 (Copilot review catch)
Kernel binaries are intentionally not included - CI's kernel-binaries job
cross-builds and auto-commits all 6 platform binaries once this merges.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* chore: update prediction kernel binaries for all platforms
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 87cb016 commit 2eb3466
13 files changed
Lines changed: 178 additions & 16 deletions
File tree
- apps/predbat
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 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 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
325 | 377 | | |
326 | 378 | | |
327 | 379 | | |
| |||
741 | 793 | | |
742 | 794 | | |
743 | 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 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
744 | 880 | | |
745 | 881 | | |
746 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments