ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::api::WizardInput Class Reference

An input of the wizard that is not tied to an entity of the device. More...

#include <api_wizard.h>

Public Member Functions

 WizardInput (const char *entity_id)
 
StringRef entity_id () const
 The Home Assistant entity ID, empty until the wizard sets one.
 
bool has_entity_id () const
 
size_t entity_id_count () const
 The number of entity IDs in the list, 0 until the wizard sets one.
 
template<typename F >
void for_each_entity_id (F &&callback) const
 Call callback(StringRef) for each entity ID in the list, in order.
 

Protected Attributes

const char * entity_id_
 

Detailed Description

An input of the wizard that is not tied to an entity of the device.

The entity ID the user picks is only ever read by lambdas, for example id(input).entity_id(). It lives in the same RAM buffer a linked input uses.

Definition at line 50 of file api_wizard.h.

Constructor & Destructor Documentation

◆ WizardInput()

esphome::api::WizardInput::WizardInput ( const char * entity_id)
inlineexplicit

Definition at line 52 of file api_wizard.h.

Member Function Documentation

◆ entity_id()

StringRef esphome::api::WizardInput::entity_id ( ) const
inline

The Home Assistant entity ID, empty until the wizard sets one.

For a multiple input this is the whole comma separated list, which homeassistant.action data can use as it is.

Definition at line 55 of file api_wizard.h.

◆ entity_id_count()

size_t esphome::api::WizardInput::entity_id_count ( ) const
inline

The number of entity IDs in the list, 0 until the wizard sets one.

Definition at line 59 of file api_wizard.h.

◆ for_each_entity_id()

template<typename F >
void esphome::api::WizardInput::for_each_entity_id ( F && callback) const
inline

Call callback(StringRef) for each entity ID in the list, in order.

The StringRef points into the list and is not null terminated, so print it with "%.*s".

Definition at line 69 of file api_wizard.h.

◆ has_entity_id()

bool esphome::api::WizardInput::has_entity_id ( ) const
inline

Definition at line 56 of file api_wizard.h.

Field Documentation

◆ entity_id_

const char* esphome::api::WizardInput::entity_id_
protected

Definition at line 83 of file api_wizard.h.


The documentation for this class was generated from the following file: