diff --git a/components/tc_bus/tc_bus.cpp b/components/tc_bus/tc_bus.cpp index 8b0bd7e..199da3f 100644 --- a/components/tc_bus/tc_bus.cpp +++ b/components/tc_bus/tc_bus.cpp @@ -325,19 +325,15 @@ namespace esphome // Turn off reading_eeprom_ = false; - - - const char* hexChars = "0123456789abcdef"; std::string hexString(eeprom_buffer_.size() * 2, ' '); // Reserviere den String mit fester Größe for (std::size_t i = 0; i < eeprom_buffer_.size(); ++i) { uint8_t byte = eeprom_buffer_[i]; - hexString[2 * i] = hexChars[(byte >> 4) & 0xF]; - hexString[2 * i + 1] = hexChars[byte & 0xF]; + hexString += format_hex(byte); } - ESP_LOGD(TAG, "Reading EEPROM: Result: %s", hexString); + ESP_LOGD(TAG, "Reading EEPROM: Count: %i, Result: %s", eeprom_buffer_.size(), hexString); } else {