diff --git a/esphome/components/nfc/ndef_message.h b/esphome/components/nfc/ndef_message.h index d2ffa9582e..20140e8c1a 100644 --- a/esphome/components/nfc/ndef_message.h +++ b/esphome/components/nfc/ndef_message.h @@ -22,7 +22,7 @@ class NdefMessage { } } - const std::vector> &get_records() { return this->records_; }; + const std::vector> &get_records() { return this->records_; }; bool add_record(std::unique_ptr record); bool add_text_record(const std::string &text); @@ -32,7 +32,7 @@ class NdefMessage { std::vector encode(); protected: - std::vector> records_; + std::vector> records_; }; } // namespace nfc diff --git a/esphome/components/nfc/nfc_tag.h b/esphome/components/nfc/nfc_tag.h index ab6ca650e4..2dfc431428 100644 --- a/esphome/components/nfc/nfc_tag.h +++ b/esphome/components/nfc/nfc_tag.h @@ -43,13 +43,13 @@ class NfcTag { std::vector &get_uid() { return this->uid_; }; const std::string &get_tag_type() { return this->tag_type_; }; bool has_ndef_message() { return this->ndef_message_ != nullptr; }; - const std::unique_ptr &get_ndef_message() { return this->ndef_message_; }; + const std::shared_ptr &get_ndef_message() { return this->ndef_message_; }; void set_ndef_message(std::unique_ptr ndef_message) { this->ndef_message_ = std::move(ndef_message); }; protected: std::vector uid_; std::string tag_type_; - std::unique_ptr ndef_message_; + std::shared_ptr ndef_message_; }; } // namespace nfc