16 LOG_BUTTON(
"",
"Homeassistant Button",
this);
17 ESP_LOGCONFIG(TAG,
" Entity ID: '%s'", this->
entity_id_);
24 ESP_LOGE(TAG,
"No clients connected to API server");
28#ifdef USE_API_WIZARD_LINKED_INPUTS
30 ESP_LOGW(TAG,
"'%s': No entity ID set yet", this->
get_name().c_str());
36 static const char SERVICE_BUTTON[] PROGMEM =
"button.press";
37 static const char SERVICE_INPUT_BUTTON[] PROGMEM =
"input_button.press";
38 static const char ENTITY_ID_KEY[] PROGMEM =
"entity_id";
42 const bool input_helper = ESPHOME_strncmp_P(this->
entity_id_, SERVICE_INPUT_BUTTON,
sizeof(
"input_") - 1) == 0;
47 auto &entity_id_kv = resp.
data.emplace_back();
const StringRef & get_name() const
A string that may live in flash (on ESP8266): pointer and length, with no byte-reading operations.
static constexpr ProgmemStringRef from_lit(const char(&s)[N])
A PROGMEM char array, with its length known at compile time.
StringRef is a reference to a string owned by something else.
void send_homeassistant_action(const HomeassistantActionRequest &call)
FixedVector< HomeassistantServiceMap > data
APIServer * global_api_server
ESPHOME_LOG_TAG(TAG, "homeassistant.binary_sensor")
constexpr float AFTER_CONNECTION
For components that should be initialized after a data connection (API/MQTT) is connected.