12static const char *
const TAG =
"homeassistant.button";
15 LOG_BUTTON(
"",
"Homeassistant Button",
this);
16 ESP_LOGCONFIG(TAG,
" Entity ID: '%s'", this->
entity_id_);
23 ESP_LOGE(TAG,
"No clients connected to API server");
27#ifdef USE_API_WIZARD_LINKED_INPUTS
29 ESP_LOGW(TAG,
"'%s': No entity ID set yet", this->
get_name().c_str());
37 static constexpr char INPUT_PREFIX[] =
"input_";
40 if (strncmp(this->
entity_id_, INPUT_PREFIX,
sizeof(INPUT_PREFIX) - 1) == 0) {
41 resp.
service = SERVICE_INPUT_BUTTON;
47 auto &entity_id_kv = resp.
data.emplace_back();
48 entity_id_kv.key = ENTITY_ID_KEY;
const StringRef & get_name() const
StringRef is a reference to a string owned by something else.
static constexpr StringRef from_lit(const CharT(&s)[N])
void send_homeassistant_action(const HomeassistantActionRequest &call)
FixedVector< HomeassistantServiceMap > data
APIServer * global_api_server
constexpr float AFTER_CONNECTION
For components that should be initialized after a data connection (API/MQTT) is connected.