17 ESP_LOGE(TAG,
"No clients connected to API server");
21#ifdef USE_API_WIZARD_LINKED_INPUTS
23 ESP_LOGW(TAG,
"'%s': No entity ID set yet", LOG_STR_ARG(button->get_log_name()));
29 static const char SERVICE_BUTTON[]
PROGMEM =
"button.press";
30 static const char SERVICE_INPUT_BUTTON[]
PROGMEM =
"input_button.press";
31 static const char ENTITY_ID_KEY[]
PROGMEM =
"entity_id";
35 const bool input_helper = ESPHOME_strncmp_P(
entity_id, SERVICE_INPUT_BUTTON,
sizeof(
"input_") - 1) == 0;
40 auto &entity_id_kv = resp.
data.emplace_back();
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.
bool send_homeassistant_action(const HomeassistantActionRequest &call)
Returns false when no subscribed client took the request, so it was dropped.
FixedVector< HomeassistantServiceMap > data
APIServer * global_api_server
static void const char * entity_id
void press_button_entity(button::Button *button, const char *entity_id)
Ask Home Assistant to press entity_id, with input_button.press for an input_button helper.
ESPHOME_LOG_TAG(TAG, "homeassistant.binary_sensor")
constexpr ColorMode COLOR_MODE_LOOKUP[] PROGMEM