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.

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

533533 self._settings.update({s.id_: s for s in self.__settings_arm_fw_19})
534534 except RequestRejectedException as ex:
535535 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.")
537537 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
538541
539542 # Check and add Peak Shaving settings added in (ETU fw 22)
540543 try:
542545 self._settings.update({s.id_: s for s in self.__settings_arm_fw_22})
543546 except RequestRejectedException as ex:
544547 if ex.message == ILLEGAL_DATA_ADDRESS:
545- logger.debug("Cannot read PeakShaving setting, disabling it.")
548+ logger.debug("PeakShaving setting not supported, disabling it.")
546549 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
547553
548554 async def read_runtime_data(self) -> Dict[str, Any]:
549555 response = await self._read_from_socket(self._READ_RUNNING_DATA)
556562 data.update(self._map_response(response, self._sensors_battery))
557563 except RequestRejectedException as ex:
558564 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.")
560566 self._has_battery = False
561567 else:
562568 raise ex
567573 self._map_response(response, self._sensors_battery2))
568574 except RequestRejectedException as ex:
569575 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.")
571577 self._has_battery2 = False
572578 else:
573579 raise ex
578584 data.update(self._map_response(response, self._sensors_meter))
579585 except RequestRejectedException as ex:
580586 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.")
582588 self._has_meter_extended = False
583589 self._sensors_meter = tuple(filter(self._not_extended_meter, self._sensors_meter))
584590 response = await self._read_from_socket(self._READ_METER_DATA)
596602 data.update(self._map_response(response, self._sensors_mppt))
597603 except RequestRejectedException as ex:
598604 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.")
600606 self._has_mppt = False
601607 else:
602608 raise ex

The check that tells the two apart

failpass·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