Commit fe21b51
refactor: resolve a device's config entry without the deprecated attribute
DeviceEntry.config_entries is deprecated in Core 2026.8 and removed in 2027.8 —
a device now belongs to exactly one config entry, exposed as config_entry_id.
Reading the old attribute on a new core writes a deprecation warning naming this
integration into the user's log, which is how another project's rename turns into
bug reports here.
Seven service handlers each carried a byte-identical copy of the same five-line
lookup. They now share _config_entry_id_for_device(), so the version handling
lives in one place — the same argument as the v1.3.5/v1.3.6 block-size bug, where
a fix applied to one of two identical blocks left the other raising every poll.
Selects on hasattr rather than on the value: the deprecated attribute still
exists behind a compatibility shim on a new core, so testing its value would
touch it and emit the warning being avoided.
Backwards compatible both ways — the legacy set is still read on cores below
2026.8, and a device spanning several integrations still resolves to whichever
entry is a loaded Growatt one.
No version bump; this rides along with the next release.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 473faef commit fe21b51
2 files changed
Lines changed: 147 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
50 | 79 | | |
51 | 80 | | |
52 | 81 | | |
| |||
587 | 616 | | |
588 | 617 | | |
589 | 618 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 619 | + | |
595 | 620 | | |
596 | 621 | | |
597 | 622 | | |
| |||
642 | 667 | | |
643 | 668 | | |
644 | 669 | | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
| 670 | + | |
650 | 671 | | |
651 | 672 | | |
652 | 673 | | |
| |||
683 | 704 | | |
684 | 705 | | |
685 | 706 | | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 707 | + | |
691 | 708 | | |
692 | 709 | | |
693 | 710 | | |
| |||
890 | 907 | | |
891 | 908 | | |
892 | 909 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
| 910 | + | |
898 | 911 | | |
899 | 912 | | |
900 | 913 | | |
| |||
1087 | 1100 | | |
1088 | 1101 | | |
1089 | 1102 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
| 1103 | + | |
1095 | 1104 | | |
1096 | 1105 | | |
1097 | 1106 | | |
| |||
1192 | 1201 | | |
1193 | 1202 | | |
1194 | 1203 | | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
| 1204 | + | |
1200 | 1205 | | |
1201 | 1206 | | |
1202 | 1207 | | |
| |||
1261 | 1266 | | |
1262 | 1267 | | |
1263 | 1268 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
| 1269 | + | |
1269 | 1270 | | |
1270 | 1271 | | |
1271 | 1272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
0 commit comments