Whole file
marcelblijleven/goodwe
The author described this change as “Fix writing single byte settings on ES inverters”. It counts as a record because the check below fails on the code as it stood at 5f1811df4 and passes on 337a7993b, with nothing else changed between the two runs.
Projectmarcelblijleven/goodwe
Fix saved2024-05-12
Sharing licenceMIT · LICENSE
Change size+1 −2
What the code was meant to do, written into the code itself as a save note
Fix writing single byte settings on ES inverters
The change
| 254 | 254 | # modbus can address/store only 16 bit values, read the other 8 bytes | |
| 255 | 255 | if self._is_modbus_setting(setting): | |
| 256 | 256 | response = await self._read_from_socket(self._read_command(setting.offset, 1)) | |
| 257 | - | raw_value = setting.encode_value(value, response.response_data()[0:2]) | |
| 258 | 257 | else: | |
| 259 | 258 | response = await self._read_from_socket(Aa55ReadCommand(setting.offset, 1)) | |
| 260 | - | raw_value = setting.encode_value(value, response.response_data()[2:4]) | |
| 259 | + | raw_value = setting.encode_value(value, response.response_data()[0:2]) | |
| 261 | 260 | else: | |
| 262 | 261 | raw_value = setting.encode_value(value) | |
| 263 | 262 | if len(raw_value) <= 2: |
The check that tells the two apart
fail→pass·tests/test_es.py::GW5048D_ES_Test::test_write_setting
Check file tests/test_es.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 it5f1811df4c813ac9bb2661bd7c90f531fc82c4b4
Broken version dated2024-05-12
Modulegoodwe.es
Units changedES
Fingerprinta1ba428cec6d4dc6
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
- 2026-03-29Fix duplicate sensor registrations
- 2024-05-14Fix decoding 0 energy values
- 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