Repository navigation
Commit 9b5e1b4
fix(solis): initialise capacity_voltage_warned so publish_entities stops crashing
#4502 added a once-per-inverter warning for the estimated battery capacity
voltage, guarded by self.capacity_voltage_warned, but only initialised that set
in MockSolisAPI - never in SolisAPI.initialize(). Any install without
solis_nominal_voltage set in apps.yaml (i.e. almost all of them) therefore takes
the fallback branch on the first publish_entities() run and raises
"'SolisAPI' object has no attribute 'capacity_voltage_warned'", aborting the
update cycle so no plan is ever produced.
MockSolisAPI replaces __init__ wholesale, which is why the whole test suite
passed against a component that could not survive a single real poll. Add a
parity guard that constructs the real component and asserts it sets every
attribute the mock stubs, so this class of divergence fails in CI rather than on
a live inverter. Drop storage_modes from the mock while doing so - it is
referenced nowhere in solis.py.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent e86772e commit 9b5e1b4
3 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
778 | 777 | | |
779 | 778 | | |
780 | 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 | + | |
781 | 804 | | |
782 | 805 | | |
783 | 806 | | |
| |||
1018 | 1041 | | |
1019 | 1042 | | |
1020 | 1043 | | |
| 1044 | + | |
1021 | 1045 | | |
1022 | 1046 | | |
1023 | 1047 | | |
| |||
0 commit comments