Whole file
marcelblijleven/goodwe
The author described this change as “Fix duplicate sensor registrations”. It counts as a record because the check below fails on the code as it stood at f98486975 and passes on 66dfcdd9c, with nothing else changed between the two runs.
Projectmarcelblijleven/goodwe
Fix saved2026-03-29
Sharing licenceMIT · LICENSE
Change size+7 −6
What the code was meant to do, written into the code itself as a save note
Fix duplicate sensor registrations
The change
| 1120 | 1120 | return self._sensors_map.get(sensor_id) | |
| 1121 | 1121 | ||
| 1122 | 1122 | def sensors(self) -> tuple[Sensor, ...]: | |
| 1123 | - | result = self._sensors + self._sensors_meter | |
| 1123 | + | result = {s.id_: s for s in self._sensors} | |
| 1124 | + | result.update({s.id_: s for s in self._sensors_meter}) | |
| 1124 | 1125 | if self._has_battery: | |
| 1125 | - | result = result + self._sensors_battery | |
| 1126 | + | result.update({s.id_: s for s in self._sensors_battery}) | |
| 1126 | 1127 | if self._has_battery2: | |
| 1127 | - | result = result + self._sensors_battery2 | |
| 1128 | - | result = result + self._sensors_battery2_extended | |
| 1128 | + | result.update({s.id_: s for s in self._sensors_battery2}) | |
| 1129 | + | result.update({s.id_: s for s in self._sensors_battery2_extended}) | |
| 1129 | 1130 | if self._has_mppt: | |
| 1130 | - | result = result + self._sensors_mppt | |
| 1131 | - | return result | |
| 1131 | + | result.update({s.id_: s for s in self._sensors_mppt}) | |
| 1132 | + | return result.values() | |
| 1132 | 1133 | ||
| 1133 | 1134 | def settings(self) -> tuple[Sensor, ...]: | |
| 1134 | 1135 | return tuple(self._settings.values()) |
The check that tells the two apart
fail→pass·tests/test_et.py::GW20K_ET_Test::test_GW20K_ET_runtime_data
Check file tests/test_et.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itf98486975494238fe3091a8a24fc2e65e37bc539
Broken version dated2026-03-29
Modulegoodwe.et
Units changedET
Fingerprint6ddd410a6365c003
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in marcelblijleven/goodwe
- 2024-05-14Fix decoding 0 energy values
- 2024-05-12Fix writing single byte settings on ES inverters
- 2024-05-08Fix setup of BT inverters
- 2024-04-08Fix decoding of voltage values
- 2024-01-09Fix deconding 0x55 as not-set value of EcoMode
- 2023-12-31Fix unit of current MPPT sensors