I was hoping to directly call HomeAssistant::get()->homeassistant_tag_scanned_to_code in a C++ code (avoiding the .yaml), but I’m not even close to that - I can’t even get a log message to work lol
I have this code
bool KeyVerify::tag_check(const std::string &tag) {
for (const auto &guest : guest_list_) {
if (tag == guest.tag()) {
guest_name_ = "John";
guest_role_ = "work";
ESP_LOGD("key_verify approves %s", guest_name_.c_str());
ESP_LOGD("role: %s using tag", guest_role_.c_str());
ESP_LOGD("but both %s, together %s, is a problem", guest_name_.c_str(), guest_role_.c_str());
return verified_ = true;
}
yielding an unexpected result
[14:01:56][D][key_verify approves %s:036]: John
[14:01:56][D][role: %s using tag:037]: work
[14:01:56][D][but both %s, together %s, is a problem:038]: John
so I’m a bit disappointed in my progress so far lol. It’s a basic thing, but it wasn’t mirroring the syntax of printf (and I thought it did).
but while you’re here, if you could point me in the appropriate direction for what to #include to and how to format homeassistant_tag_scanned_to_code() to send directly to the API, that would also be much appreciated!