Whole file
marcelblijleven/goodwe
The author described this change as “Fix setup of BT inverters”. It counts as a record because the check below fails on the code as it stood at 1449f9a33 and passes on 702b53a7e, with nothing else changed between the two runs.
Projectmarcelblijleven/goodwe
Fix saved2024-05-08
Sharing licenceMIT · LICENSE
Change size+12 −6
What the code was meant to do, written into the code itself as a save note
Fix setup of BT inverters
The change
| 533 | 533 | self._settings.update({s.id_: s for s in self.__settings_arm_fw_19}) | |
| 534 | 534 | except RequestRejectedException as ex: | |
| 535 | 535 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 536 | - | logger.debug("Cannot read EcoModeV2 settings, using to EcoModeV1.") | |
| 536 | + | logger.debug("EcoModeV2 settings not supported, switching to EcoModeV1.") | |
| 537 | 537 | self._has_eco_mode_v2 = False | |
| 538 | + | except RequestFailedException: | |
| 539 | + | logger.debug("Cannot read EcoModeV2 settings, switching to EcoModeV1.") | |
| 540 | + | self._has_eco_mode_v2 = False | |
| 538 | 541 | ||
| 539 | 542 | # Check and add Peak Shaving settings added in (ETU fw 22) | |
| 540 | 543 | try: | |
| ⋯ | |||
| 542 | 545 | self._settings.update({s.id_: s for s in self.__settings_arm_fw_22}) | |
| 543 | 546 | except RequestRejectedException as ex: | |
| 544 | 547 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 545 | - | logger.debug("Cannot read PeakShaving setting, disabling it.") | |
| 548 | + | logger.debug("PeakShaving setting not supported, disabling it.") | |
| 546 | 549 | self._has_peak_shaving = False | |
| 550 | + | except RequestFailedException: | |
| 551 | + | logger.debug("Cannot read _has_peak_shaving settings, disabling it.") | |
| 552 | + | self._has_peak_shaving = False | |
| 547 | 553 | ||
| 548 | 554 | async def read_runtime_data(self) -> Dict[str, Any]: | |
| 549 | 555 | response = await self._read_from_socket(self._READ_RUNNING_DATA) | |
| ⋯ | |||
| 556 | 562 | data.update(self._map_response(response, self._sensors_battery)) | |
| 557 | 563 | except RequestRejectedException as ex: | |
| 558 | 564 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 559 | - | logger.warning("Cannot read battery values, disabling further attempts.") | |
| 565 | + | logger.info("Battery values not supported, disabling further attempts.") | |
| 560 | 566 | self._has_battery = False | |
| 561 | 567 | else: | |
| 562 | 568 | raise ex | |
| ⋯ | |||
| 567 | 573 | self._map_response(response, self._sensors_battery2)) | |
| 568 | 574 | except RequestRejectedException as ex: | |
| 569 | 575 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 570 | - | logger.warning("Cannot read battery 2 values, disabling further attempts.") | |
| 576 | + | logger.info("Battery 2 values not supported, disabling further attempts.") | |
| 571 | 577 | self._has_battery2 = False | |
| 572 | 578 | else: | |
| 573 | 579 | raise ex | |
| ⋯ | |||
| 578 | 584 | data.update(self._map_response(response, self._sensors_meter)) | |
| 579 | 585 | except RequestRejectedException as ex: | |
| 580 | 586 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 581 | - | logger.warning("Cannot read extended meter values, disabling further attempts.") | |
| 587 | + | logger.info("Extended meter values not supported, disabling further attempts.") | |
| 582 | 588 | self._has_meter_extended = False | |
| 583 | 589 | self._sensors_meter = tuple(filter(self._not_extended_meter, self._sensors_meter)) | |
| 584 | 590 | response = await self._read_from_socket(self._READ_METER_DATA) | |
| ⋯ | |||
| 596 | 602 | data.update(self._map_response(response, self._sensors_mppt)) | |
| 597 | 603 | except RequestRejectedException as ex: | |
| 598 | 604 | if ex.message == ILLEGAL_DATA_ADDRESS: | |
| 599 | - | logger.warning("Cannot read MPPT values, disabling further attempts.") | |
| 605 | + | logger.info("MPPT values not supported, disabling further attempts.") | |
| 600 | 606 | self._has_mppt = False | |
| 601 | 607 | else: | |
| 602 | 608 | raise ex | |
The check that tells the two apart
fail→pass·tests/test_et.py::GW5K_BT_Test::test_GW5K_BT_device_info
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 it1449f9a33994ae40d069bfd153982001d942900c
Broken version dated2024-05-06
Modulegoodwe.et
Units changedET
Fingerprint5116e3b5b5ea0980
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-12Fix writing single byte settings on ES 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