ESPHome  2024.11.1
binary_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
7 #include "esphome/core/helpers.h"
8 
9 namespace esphome {
10 namespace nfc {
11 
13  public Component,
14  public NfcTagListener,
15  public Parented<Nfcc> {
16  public:
17  void setup() override;
18  void dump_config() override;
19 
20  void set_ndef_match_string(const std::string &str);
21  void set_tag_name(const std::string &str);
22  void set_uid(const std::vector<uint8_t> &uid);
23 
24  bool tag_match_ndef_string(const std::shared_ptr<NdefMessage> &msg);
25  bool tag_match_tag_name(const std::shared_ptr<NdefMessage> &msg);
26  bool tag_match_uid(const std::vector<uint8_t> &data);
27 
28  void tag_off(NfcTag &tag) override;
29  void tag_on(NfcTag &tag) override;
30 
31  protected:
32  bool match_tag_name_{false};
33  std::string match_string_;
34  std::vector<uint8_t> uid_;
35 };
36 
37 } // namespace nfc
38 } // namespace esphome
std::vector< uint8_t > uid_
Definition: binary_sensor.h:34
void set_ndef_match_string(const std::string &str)
void set_uid(const std::vector< uint8_t > &uid)
bool tag_match_ndef_string(const std::shared_ptr< NdefMessage > &msg)
bool tag_match_tag_name(const std::shared_ptr< NdefMessage > &msg)
void set_tag_name(const std::string &str)
void tag_on(NfcTag &tag) override
void tag_off(NfcTag &tag) override
bool tag_match_uid(const std::vector< uint8_t > &data)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37
Helper class to easily give an object a parent of type T.
Definition: helpers.h:522