diff --git a/esphome/components/nfc/automation.cpp b/esphome/components/nfc/automation.cpp index 3a45dbdb18..e2956e4c12 100644 --- a/esphome/components/nfc/automation.cpp +++ b/esphome/components/nfc/automation.cpp @@ -6,8 +6,7 @@ namespace nfc { void NfcOnTagTrigger::process(const std::unique_ptr &tag) { char uid_buf[FORMAT_UID_BUFFER_SIZE]; - format_uid_to(uid_buf, tag->get_uid()); - this->trigger(std::string(uid_buf), *tag); + this->trigger(std::string(format_uid_to(uid_buf, tag->get_uid())), *tag); } } // namespace nfc diff --git a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp index 0f5b7db117..b62b243cc6 100644 --- a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp +++ b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp @@ -26,8 +26,7 @@ void NfcTagBinarySensor::dump_config() { } if (!this->uid_.empty()) { char uid_buf[FORMAT_BYTES_BUFFER_SIZE]; - format_bytes_to(uid_buf, this->uid_); - ESP_LOGCONFIG(TAG, " Tag UID: %s", uid_buf); + ESP_LOGCONFIG(TAG, " Tag UID: %s", format_bytes_to(uid_buf, this->uid_)); } }