ESPHome 2026.3.3
Loading...
Searching...
No Matches
esphome::api Namespace Reference

Namespaces

namespace  enums
 

Data Structures

class  ActionResponse
 
class  AlarmControlPanelCommandRequest
 
class  AlarmControlPanelStateResponse
 
class  APIBuffer
 Byte buffer that skips zero-initialization on resize(). More...
 
class  APIConnectedCondition
 
class  APIConnection
 
class  APIFrameHelper
 
class  APINoiseContext
 
class  APINoiseFrameHelper
 
class  APIPlaintextFrameHelper
 
class  APIRespondAction
 
class  APIServer
 
class  APIServerConnectionBase
 
class  APIUnregisterServiceCallAction
 
class  AreaInfo
 
class  BinarySensorStateResponse
 
class  BluetoothConnectionsFreeResponse
 
class  BluetoothDeviceClearCacheResponse
 
class  BluetoothDeviceConnectionResponse
 
class  BluetoothDevicePairingResponse
 
class  BluetoothDeviceRequest
 
class  BluetoothDeviceUnpairingResponse
 
class  BluetoothGATTCharacteristic
 
class  BluetoothGATTDescriptor
 
class  BluetoothGATTErrorResponse
 
class  BluetoothGATTGetServicesDoneResponse
 
class  BluetoothGATTGetServicesRequest
 
class  BluetoothGATTGetServicesResponse
 
class  BluetoothGATTNotifyDataResponse
 
class  BluetoothGATTNotifyRequest
 
class  BluetoothGATTNotifyResponse
 
class  BluetoothGATTReadDescriptorRequest
 
class  BluetoothGATTReadRequest
 
class  BluetoothGATTReadResponse
 
class  BluetoothGATTService
 
class  BluetoothGATTWriteDescriptorRequest
 
class  BluetoothGATTWriteRequest
 
class  BluetoothGATTWriteResponse
 
class  BluetoothLERawAdvertisement
 
class  BluetoothLERawAdvertisementsResponse
 
class  BluetoothScannerSetModeRequest
 
class  BluetoothScannerStateResponse
 
class  BluetoothSetConnectionParamsRequest
 
class  BluetoothSetConnectionParamsResponse
 
class  ButtonCommandRequest
 
class  CameraImageRequest
 
class  CameraImageResponse
 
class  ClimateCommandRequest
 
class  ClimateStateResponse
 
class  CommandProtoMessage
 
class  CoverCommandRequest
 
class  CoverStateResponse
 
class  CustomAPIDevice
 
class  CustomAPIDeviceService
 
class  DateCommandRequest
 
class  DateStateResponse
 
class  DateTimeCommandRequest
 
class  DateTimeStateResponse
 
class  DeviceInfo
 
class  DeviceInfoResponse
 
class  DisconnectRequest
 
class  DisconnectResponse
 
class  DSTRule
 
class  DumpBuffer
 Fixed-size buffer for message dumps - avoids heap allocation. More...
 
class  EventResponse
 
class  ExecuteServiceArgument
 
class  ExecuteServiceRequest
 
class  ExecuteServiceResponse
 
class  FanCommandRequest
 
class  FanStateResponse
 
class  GetTimeRequest
 
class  GetTimeResponse
 
class  HelloRequest
 
class  HelloResponse
 
class  HomeassistantActionRequest
 
class  HomeassistantActionResponse
 
class  HomeAssistantServiceCallAction
 
class  HomeassistantServiceMap
 
class  HomeAssistantStateResponse
 
class  InfoResponseProtoMessage
 
class  InfraredRFReceiveEvent
 
class  InfraredRFTransmitRawTimingsRequest
 
class  InitialStateIterator
 
class  LightCommandRequest
 
class  LightStateResponse
 
class  ListEntitiesAlarmControlPanelResponse
 
class  ListEntitiesBinarySensorResponse
 
class  ListEntitiesButtonResponse
 
class  ListEntitiesCameraResponse
 
class  ListEntitiesClimateResponse
 
class  ListEntitiesCoverResponse
 
class  ListEntitiesDateResponse
 
class  ListEntitiesDateTimeResponse
 
class  ListEntitiesDoneResponse
 
class  ListEntitiesEventResponse
 
class  ListEntitiesFanResponse
 
class  ListEntitiesInfraredResponse
 
class  ListEntitiesIterator
 
class  ListEntitiesLightResponse
 
class  ListEntitiesLockResponse
 
class  ListEntitiesMediaPlayerResponse
 
class  ListEntitiesNumberResponse
 
class  ListEntitiesSelectResponse
 
class  ListEntitiesSensorResponse
 
class  ListEntitiesServicesArgument
 
class  ListEntitiesServicesResponse
 
class  ListEntitiesSirenResponse
 
class  ListEntitiesSwitchResponse
 
class  ListEntitiesTextResponse
 
class  ListEntitiesTextSensorResponse
 
class  ListEntitiesTimeResponse
 
class  ListEntitiesUpdateResponse
 
class  ListEntitiesValveResponse
 
class  ListEntitiesWaterHeaterResponse
 
class  LockCommandRequest
 
class  LockStateResponse
 
class  MediaPlayerCommandRequest
 
class  MediaPlayerStateResponse
 
class  MediaPlayerSupportedFormat
 
struct  MessageInfo
 
class  NoiseEncryptionSetKeyRequest
 
class  NoiseEncryptionSetKeyResponse
 
class  NumberCommandRequest
 
class  NumberStateResponse
 
class  ParsedTimezone
 
class  PingRequest
 
class  PingResponse
 
class  Proto32Bit
 
class  ProtoDecodableMessage
 
class  ProtoLengthDelimited
 
class  ProtoMessage
 
class  ProtoService
 
class  ProtoSize
 
class  ProtoVarInt
 Static varint parsing methods for the protobuf wire format. More...
 
struct  ProtoVarIntResult
 Result of parsing a varint: value + number of bytes consumed. More...
 
class  ProtoWriteBuffer
 
struct  ReadPacketBuffer
 
struct  SavedNoisePsk
 
class  SelectCommandRequest
 
class  SelectStateResponse
 
class  SensorStateResponse
 
class  SerialProxyConfigureRequest
 
class  SerialProxyDataReceived
 
class  SerialProxyGetModemPinsRequest
 
class  SerialProxyGetModemPinsResponse
 
class  SerialProxyInfo
 
class  SerialProxyRequest
 
class  SerialProxyRequestResponse
 
class  SerialProxySetModemPinsRequest
 
class  SerialProxyWriteRequest
 
class  SirenCommandRequest
 
class  SirenStateResponse
 
class  StateResponseProtoMessage
 
class  SubscribeBluetoothLEAdvertisementsRequest
 
class  SubscribeHomeAssistantStateResponse
 
class  SubscribeLogsRequest
 
class  SubscribeLogsResponse
 
class  SubscribeVoiceAssistantRequest
 
class  SwitchCommandRequest
 
class  SwitchStateResponse
 
class  TemplatableKeyValuePair
 
class  TemplatableStringValue
 
class  TextCommandRequest
 
class  TextSensorStateResponse
 
class  TextStateResponse
 
class  TimeCommandRequest
 
class  TimeStateResponse
 
class  UpdateCommandRequest
 
class  UpdateStateResponse
 
class  UserServiceBase
 
class  UserServiceDescriptor
 
class  UserServiceDynamic
 
class  UserServiceTrigger
 
class  UserServiceTrigger< enums::SUPPORTS_RESPONSE_NONE, Ts... >
 
class  UserServiceTrigger< enums::SUPPORTS_RESPONSE_ONLY, Ts... >
 
class  UserServiceTrigger< enums::SUPPORTS_RESPONSE_OPTIONAL, Ts... >
 
class  UserServiceTrigger< enums::SUPPORTS_RESPONSE_STATUS, Ts... >
 
class  ValveCommandRequest
 
class  ValveStateResponse
 
class  VoiceAssistantAnnounceFinished
 
class  VoiceAssistantAnnounceRequest
 
class  VoiceAssistantAudio
 
class  VoiceAssistantAudioSettings
 
class  VoiceAssistantConfigurationRequest
 
class  VoiceAssistantConfigurationResponse
 
class  VoiceAssistantEventData
 
class  VoiceAssistantEventResponse
 
class  VoiceAssistantExternalWakeWord
 
class  VoiceAssistantRequest
 
class  VoiceAssistantResponse
 
class  VoiceAssistantSetConfiguration
 
class  VoiceAssistantTimerEventResponse
 
class  VoiceAssistantWakeWord
 
class  WaterHeaterCommandRequest
 
class  WaterHeaterStateResponse
 
class  ZWaveProxyFrame
 
class  ZWaveProxyRequest
 

Typedefs

using psk_t = std::array<uint8_t, 32>
 
template<typename... Ts>
using ActionResponseCallback = std::function<void(const ActionResponse &, Ts...)>
 
using proto_varint_value_t = uint64_t
 Type used for decoded varint values - uint64_t when BLE needs 64-bit addresses, uint32_t otherwise.
 

Enumerations

enum class  APIError : uint16_t {
  OK = 0 , WOULD_BLOCK = 1001 , BAD_INDICATOR = 1003 , BAD_DATA_PACKET = 1004 ,
  TCP_NODELAY_FAILED = 1005 , TCP_NONBLOCKING_FAILED = 1006 , CLOSE_FAILED = 1007 , SHUTDOWN_FAILED = 1008 ,
  BAD_STATE = 1009 , BAD_ARG = 1010 , SOCKET_READ_FAILED = 1011 , SOCKET_WRITE_FAILED = 1012 ,
  OUT_OF_MEMORY = 1018 , CONNECTION_CLOSED = 1022 , BAD_HANDSHAKE_PACKET_LEN = 1002 , HANDSHAKESTATE_READ_FAILED = 1013 ,
  HANDSHAKESTATE_WRITE_FAILED = 1014 , HANDSHAKESTATE_BAD_STATE = 1015 , CIPHERSTATE_DECRYPT_FAILED = 1016 , CIPHERSTATE_ENCRYPT_FAILED = 1017 ,
  HANDSHAKESTATE_SETUP_FAILED = 1019 , HANDSHAKESTATE_SPLIT_FAILED = 1020 , BAD_HANDSHAKE_ERROR_BYTE = 1021
}
 

Functions

std::unique_ptr< uint8_t[]> make_buffer (size_t n)
 Helper to use make_unique_for_overwrite where available (skips zero-fill), falling back to make_unique on older GCC (ESP8266, LibreTiny).
 
void __attribute__ ((flatten)) APIConnection
 
const LogString * api_error_to_logstr (APIError err)
 
const LogString * noise_err_to_logstr (int err)
 Convert a noise error code to a readable error.
 
void noise_rand_bytes (void *output, size_t len)
 
template<>
const char * proto_enum_to_string< enums::SerialProxyPortType > (enums::SerialProxyPortType value)
 
template<>
const char * proto_enum_to_string< enums::EntityCategory > (enums::EntityCategory value)
 
template<>
const char * proto_enum_to_string< enums::CoverOperation > (enums::CoverOperation value)
 
template<>
const char * proto_enum_to_string< enums::FanDirection > (enums::FanDirection value)
 
template<>
const char * proto_enum_to_string< enums::ColorMode > (enums::ColorMode value)
 
template<>
const char * proto_enum_to_string< enums::SensorStateClass > (enums::SensorStateClass value)
 
template<>
const char * proto_enum_to_string< enums::LogLevel > (enums::LogLevel value)
 
template<>
const char * proto_enum_to_string< enums::DSTRuleType > (enums::DSTRuleType value)
 
template<>
const char * proto_enum_to_string< enums::ServiceArgType > (enums::ServiceArgType value)
 
template<>
const char * proto_enum_to_string< enums::SupportsResponseType > (enums::SupportsResponseType value)
 
template<>
const char * proto_enum_to_string< enums::ClimateMode > (enums::ClimateMode value)
 
template<>
const char * proto_enum_to_string< enums::ClimateFanMode > (enums::ClimateFanMode value)
 
template<>
const char * proto_enum_to_string< enums::ClimateSwingMode > (enums::ClimateSwingMode value)
 
template<>
const char * proto_enum_to_string< enums::ClimateAction > (enums::ClimateAction value)
 
template<>
const char * proto_enum_to_string< enums::ClimatePreset > (enums::ClimatePreset value)
 
template<>
const char * proto_enum_to_string< enums::WaterHeaterMode > (enums::WaterHeaterMode value)
 
template<>
const char * proto_enum_to_string< enums::WaterHeaterCommandHasField > (enums::WaterHeaterCommandHasField value)
 
template<>
const char * proto_enum_to_string< enums::NumberMode > (enums::NumberMode value)
 
template<>
const char * proto_enum_to_string< enums::LockState > (enums::LockState value)
 
template<>
const char * proto_enum_to_string< enums::LockCommand > (enums::LockCommand value)
 
template<>
const char * proto_enum_to_string< enums::MediaPlayerState > (enums::MediaPlayerState value)
 
template<>
const char * proto_enum_to_string< enums::MediaPlayerCommand > (enums::MediaPlayerCommand value)
 
template<>
const char * proto_enum_to_string< enums::MediaPlayerFormatPurpose > (enums::MediaPlayerFormatPurpose value)
 
template<>
const char * proto_enum_to_string< enums::BluetoothDeviceRequestType > (enums::BluetoothDeviceRequestType value)
 
template<>
const char * proto_enum_to_string< enums::BluetoothScannerState > (enums::BluetoothScannerState value)
 
template<>
const char * proto_enum_to_string< enums::BluetoothScannerMode > (enums::BluetoothScannerMode value)
 
template<>
const char * proto_enum_to_string< enums::VoiceAssistantSubscribeFlag > (enums::VoiceAssistantSubscribeFlag value)
 
template<>
const char * proto_enum_to_string< enums::VoiceAssistantRequestFlag > (enums::VoiceAssistantRequestFlag value)
 
template<>
const char * proto_enum_to_string< enums::VoiceAssistantEvent > (enums::VoiceAssistantEvent value)
 
template<>
const char * proto_enum_to_string< enums::VoiceAssistantTimerEvent > (enums::VoiceAssistantTimerEvent value)
 
template<>
const char * proto_enum_to_string< enums::AlarmControlPanelState > (enums::AlarmControlPanelState value)
 
template<>
const char * proto_enum_to_string< enums::AlarmControlPanelStateCommand > (enums::AlarmControlPanelStateCommand value)
 
template<>
const char * proto_enum_to_string< enums::TextMode > (enums::TextMode value)
 
template<>
const char * proto_enum_to_string< enums::ValveOperation > (enums::ValveOperation value)
 
template<>
const char * proto_enum_to_string< enums::UpdateCommand > (enums::UpdateCommand value)
 
template<>
const char * proto_enum_to_string< enums::ZWaveProxyRequestType > (enums::ZWaveProxyRequestType value)
 
template<>
const char * proto_enum_to_string< enums::SerialProxyParity > (enums::SerialProxyParity value)
 
template<>
const char * proto_enum_to_string< enums::SerialProxyRequestType > (enums::SerialProxyRequestType value)
 
template<>
const char * proto_enum_to_string< enums::SerialProxyStatus > (enums::SerialProxyStatus value)
 
 API_DISPATCH_UPDATE (binary_sensor::BinarySensor, binary_sensor) API_DISPATCH_UPDATE(cover
 
 API_DISPATCH_UPDATE (alarm_control_panel::AlarmControlPanel, alarm_control_panel) float APIServer
 
 LIST_ENTITIES_HANDLER (binary_sensor, binary_sensor::BinarySensor, ListEntitiesBinarySensorResponse) LIST_ENTITIES_HANDLER(cover
 
ListEntitiesCoverResponse LIST_ENTITIES_HANDLER (fan, fan::Fan, ListEntitiesFanResponse) LIST_ENTITIES_HANDLER(light
 
ListEntitiesCoverResponse ListEntitiesLightResponse LIST_ENTITIES_HANDLER (sensor, sensor::Sensor, ListEntitiesSensorResponse) LIST_ENTITIES_HANDLER(switch
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse LIST_ENTITIES_HANDLER (button, button::Button, ListEntitiesButtonResponse) LIST_ENTITIES_HANDLER(text_sensor
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse LIST_ENTITIES_HANDLER (lock, lock::Lock, ListEntitiesLockResponse) LIST_ENTITIES_HANDLER(valve
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse LIST_ENTITIES_HANDLER (camera, camera::Camera, ListEntitiesCameraResponse) LIST_ENTITIES_HANDLER(climate
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse LIST_ENTITIES_HANDLER (number, number::Number, ListEntitiesNumberResponse) LIST_ENTITIES_HANDLER(date
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse ListEntitiesDateResponse LIST_ENTITIES_HANDLER (time, datetime::TimeEntity, ListEntitiesTimeResponse) LIST_ENTITIES_HANDLER(datetime
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse ListEntitiesDateResponse ListEntitiesDateTimeResponse LIST_ENTITIES_HANDLER (text, text::Text, ListEntitiesTextResponse) LIST_ENTITIES_HANDLER(select
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse ListEntitiesDateResponse ListEntitiesDateTimeResponse ListEntitiesSelectResponse LIST_ENTITIES_HANDLER (media_player, media_player::MediaPlayer, ListEntitiesMediaPlayerResponse) LIST_ENTITIES_HANDLER(alarm_control_panel
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse ListEntitiesDateResponse ListEntitiesDateTimeResponse ListEntitiesSelectResponse ListEntitiesAlarmControlPanelResponse LIST_ENTITIES_HANDLER (water_heater, water_heater::WaterHeater, ListEntitiesWaterHeaterResponse) LIST_ENTITIES_HANDLER(infrared
 
ListEntitiesCoverResponse ListEntitiesLightResponse ListEntitiesSwitchResponse ListEntitiesTextSensorResponse ListEntitiesValveResponse ListEntitiesClimateResponse ListEntitiesDateResponse ListEntitiesDateTimeResponse ListEntitiesSelectResponse ListEntitiesAlarmControlPanelResponse ListEntitiesInfraredResponse LIST_ENTITIES_HANDLER (event, event::Event, ListEntitiesEventResponse) LIST_ENTITIES_HANDLER(update
 
constexpr uint32_t encode_zigzag32 (int32_t value)
 
constexpr uint64_t encode_zigzag64 (int64_t value)
 
constexpr int32_t decode_zigzag32 (uint32_t value)
 
constexpr int64_t decode_zigzag64 (uint64_t value)
 
uint16_t count_packed_varints (const uint8_t *data, size_t len)
 Count number of varints in a packed buffer.
 
void encode_varint_to_buffer (uint32_t val, uint8_t *buffer)
 Encode a varint directly into a pre-allocated buffer.
 
template<typename T >
void proto_encode_msg (const void *msg, ProtoWriteBuffer &buf)
 
template<typename T >
const char * proto_enum_to_string (T value)
 
 INITIAL_STATE_HANDLER (binary_sensor, binary_sensor::BinarySensor) INITIAL_STATE_HANDLER(cover
 
cover::Cover INITIAL_STATE_HANDLER (fan, fan::Fan) INITIAL_STATE_HANDLER(light
 
cover::Cover light::LightState INITIAL_STATE_HANDLER (sensor, sensor::Sensor) INITIAL_STATE_HANDLER(switch
 
cover::Cover light::LightState switch_::Switch INITIAL_STATE_HANDLER (text_sensor, text_sensor::TextSensor) INITIAL_STATE_HANDLER(climate
 
cover::Cover light::LightState switch_::Switch climate::Climate INITIAL_STATE_HANDLER (number, number::Number) INITIAL_STATE_HANDLER(date
 
cover::Cover light::LightState switch_::Switch climate::Climate datetime::DateEntity INITIAL_STATE_HANDLER (time, datetime::TimeEntity) INITIAL_STATE_HANDLER(datetime
 
cover::Cover light::LightState switch_::Switch climate::Climate datetime::DateEntity datetime::DateTimeEntity INITIAL_STATE_HANDLER (text, text::Text) INITIAL_STATE_HANDLER(select
 
cover::Cover light::LightState switch_::Switch climate::Climate datetime::DateEntity datetime::DateTimeEntity select::Select INITIAL_STATE_HANDLER (lock, lock::Lock) INITIAL_STATE_HANDLER(valve
 
cover::Cover light::LightState switch_::Switch climate::Climate datetime::DateEntity datetime::DateTimeEntity select::Select valve::Valve INITIAL_STATE_HANDLER (media_player, media_player::MediaPlayer) INITIAL_STATE_HANDLER(alarm_control_panel
 
cover::Cover light::LightState switch_::Switch climate::Climate datetime::DateEntity datetime::DateTimeEntity select::Select valve::Valve alarm_control_panel::AlarmControlPanel INITIAL_STATE_HANDLER (water_heater, water_heater::WaterHeater) INITIAL_STATE_HANDLER(update
 
template<>
bool get_execute_arg_value< bool > (const ExecuteServiceArgument &arg)
 
template<>
int32_t get_execute_arg_value< int32_t > (const ExecuteServiceArgument &arg)
 
template<>
float get_execute_arg_value< float > (const ExecuteServiceArgument &arg)
 
template<>
std::string get_execute_arg_value< std::string > (const ExecuteServiceArgument &arg)
 
template<>
StringRef get_execute_arg_value< StringRef > (const ExecuteServiceArgument &arg)
 
template<>
std::vector< bool > get_execute_arg_value< std::vector< bool > > (const ExecuteServiceArgument &arg)
 
template<>
std::vector< int32_t > get_execute_arg_value< std::vector< int32_t > > (const ExecuteServiceArgument &arg)
 
template<>
std::vector< float > get_execute_arg_value< std::vector< float > > (const ExecuteServiceArgument &arg)
 
template<>
std::vector< std::string > get_execute_arg_value< std::vector< std::string > > (const ExecuteServiceArgument &arg)
 
template<>
const FixedVector< bool > & get_execute_arg_value< const FixedVector< bool > & > (const ExecuteServiceArgument &arg)
 
template<>
const FixedVector< int32_t > & get_execute_arg_value< const FixedVector< int32_t > & > (const ExecuteServiceArgument &arg)
 
template<>
const FixedVector< float > & get_execute_arg_value< const FixedVector< float > & > (const ExecuteServiceArgument &arg)
 
template<>
const FixedVector< std::string > & get_execute_arg_value< const FixedVector< std::string > & > (const ExecuteServiceArgument &arg)
 
template<>
enums::ServiceArgType to_service_arg_type< bool > ()
 
template<>
enums::ServiceArgType to_service_arg_type< int32_t > ()
 
template<>
enums::ServiceArgType to_service_arg_type< float > ()
 
template<>
enums::ServiceArgType to_service_arg_type< std::string > ()
 
template<>
enums::ServiceArgType to_service_arg_type< StringRef > ()
 
template<>
enums::ServiceArgType to_service_arg_type< std::vector< bool > > ()
 
template<>
enums::ServiceArgType to_service_arg_type< std::vector< int32_t > > ()
 
template<>
enums::ServiceArgType to_service_arg_type< std::vector< float > > ()
 
template<>
enums::ServiceArgType to_service_arg_type< std::vector< std::string > > ()
 
template<>
enums::ServiceArgType to_service_arg_type< const FixedVector< bool > & > ()
 
template<>
enums::ServiceArgType to_service_arg_type< const FixedVector< int32_t > & > ()
 
template<>
enums::ServiceArgType to_service_arg_type< const FixedVector< float > & > ()
 
template<>
enums::ServiceArgType to_service_arg_type< const FixedVector< std::string > & > ()
 
template<typename T >
get_execute_arg_value (const ExecuteServiceArgument &arg)
 
template<typename T >
enums::ServiceArgType to_service_arg_type ()
 

Variables

APIServerglobal_api_server = nullptr
 
struct esphome::api::SavedNoisePsk PACKED
 
constexpr uint8_t WIRE_TYPE_VARINT = 0
 
constexpr uint8_t WIRE_TYPE_LENGTH_DELIMITED = 2
 
constexpr uint8_t WIRE_TYPE_FIXED32 = 5
 
constexpr uint8_t WIRE_TYPE_MASK = 0b111
 
constexpr uint32_t PROTO_VARINT_PARSE_FAILED = 0
 Sentinel value for consumed field indicating parse failure.
 

Typedef Documentation

◆ ActionResponseCallback

template<typename... Ts>
using esphome::api::ActionResponseCallback = std::function<void(const ActionResponse &, Ts...)>

Definition at line 103 of file homeassistant_service.h.

◆ proto_varint_value_t

Type used for decoded varint values - uint64_t when BLE needs 64-bit addresses, uint32_t otherwise.

Definition at line 104 of file proto.h.

◆ psk_t

using esphome::api::psk_t = std::array<uint8_t, 32>

Definition at line 9 of file api_noise_context.h.

Enumeration Type Documentation

◆ APIError

enum class esphome::api::APIError : uint16_t
strong
Enumerator
OK 
WOULD_BLOCK 
BAD_INDICATOR 
BAD_DATA_PACKET 
TCP_NODELAY_FAILED 
TCP_NONBLOCKING_FAILED 
CLOSE_FAILED 
SHUTDOWN_FAILED 
BAD_STATE 
BAD_ARG 
SOCKET_READ_FAILED 
SOCKET_WRITE_FAILED 
OUT_OF_MEMORY 
CONNECTION_CLOSED 
BAD_HANDSHAKE_PACKET_LEN 
HANDSHAKESTATE_READ_FAILED 
HANDSHAKESTATE_WRITE_FAILED 
HANDSHAKESTATE_BAD_STATE 
CIPHERSTATE_DECRYPT_FAILED 
CIPHERSTATE_ENCRYPT_FAILED 
HANDSHAKESTATE_SETUP_FAILED 
HANDSHAKESTATE_SPLIT_FAILED 
BAD_HANDSHAKE_ERROR_BYTE 

Definition at line 60 of file api_frame_helper.h.

Function Documentation

◆ __attribute__()

void esphome::api::__attribute__ ( (flatten) )

Definition at line 2075 of file api_connection.cpp.

◆ API_DISPATCH_UPDATE() [1/2]

esphome::api::API_DISPATCH_UPDATE ( alarm_control_panel::AlarmControlPanel ,
alarm_control_panel  )

Definition at line 386 of file api_server.cpp.

◆ API_DISPATCH_UPDATE() [2/2]

esphome::api::API_DISPATCH_UPDATE ( binary_sensor::BinarySensor ,
binary_sensor  )

Definition at line 267 of file api_server.cpp.

◆ api_error_to_logstr()

const LogString * esphome::api::api_error_to_logstr ( APIError err)

Definition at line 48 of file api_frame_helper.cpp.

◆ count_packed_varints()

uint16_t esphome::api::count_packed_varints ( const uint8_t * data,
size_t len )
inline

Count number of varints in a packed buffer.

Definition at line 45 of file proto.h.

◆ decode_zigzag32()

int32_t esphome::api::decode_zigzag32 ( uint32_t value)
inlineconstexpr

Definition at line 36 of file proto.h.

◆ decode_zigzag64()

int64_t esphome::api::decode_zigzag64 ( uint64_t value)
inlineconstexpr

Definition at line 40 of file proto.h.

◆ encode_varint_to_buffer()

void esphome::api::encode_varint_to_buffer ( uint32_t val,
uint8_t * buffer )
inline

Encode a varint directly into a pre-allocated buffer.

Caller must ensure buffer has space (use ProtoSize::varint() to calculate).

Definition at line 64 of file proto.h.

◆ encode_zigzag32()

uint32_t esphome::api::encode_zigzag32 ( int32_t value)
inlineconstexpr

Definition at line 28 of file proto.h.

◆ encode_zigzag64()

uint64_t esphome::api::encode_zigzag64 ( int64_t value)
inlineconstexpr

Definition at line 32 of file proto.h.

◆ get_execute_arg_value()

template<typename T >
T esphome::api::get_execute_arg_value ( const ExecuteServiceArgument & arg)

◆ get_execute_arg_value< bool >()

template<>
bool esphome::api::get_execute_arg_value< bool > ( const ExecuteServiceArgument & arg)

Definition at line 7 of file user_services.cpp.

◆ get_execute_arg_value< const FixedVector< bool > & >()

template<>
const FixedVector< bool > & esphome::api::get_execute_arg_value< const FixedVector< bool > & > ( const ExecuteServiceArgument & arg)

Definition at line 46 of file user_services.cpp.

◆ get_execute_arg_value< const FixedVector< float > & >()

template<>
const FixedVector< float > & esphome::api::get_execute_arg_value< const FixedVector< float > & > ( const ExecuteServiceArgument & arg)

Definition at line 54 of file user_services.cpp.

◆ get_execute_arg_value< const FixedVector< int32_t > & >()

template<>
const FixedVector< int32_t > & esphome::api::get_execute_arg_value< const FixedVector< int32_t > & > ( const ExecuteServiceArgument & arg)

Definition at line 50 of file user_services.cpp.

◆ get_execute_arg_value< const FixedVector< std::string > & >()

template<>
const FixedVector< std::string > & esphome::api::get_execute_arg_value< const FixedVector< std::string > & > ( const ExecuteServiceArgument & arg)

Definition at line 58 of file user_services.cpp.

◆ get_execute_arg_value< float >()

template<>
float esphome::api::get_execute_arg_value< float > ( const ExecuteServiceArgument & arg)

Definition at line 13 of file user_services.cpp.

◆ get_execute_arg_value< int32_t >()

template<>
int32_t esphome::api::get_execute_arg_value< int32_t > ( const ExecuteServiceArgument & arg)

Definition at line 8 of file user_services.cpp.

◆ get_execute_arg_value< std::string >()

template<>
std::string esphome::api::get_execute_arg_value< std::string > ( const ExecuteServiceArgument & arg)

Definition at line 14 of file user_services.cpp.

◆ get_execute_arg_value< std::vector< bool > >()

template<>
std::vector< bool > esphome::api::get_execute_arg_value< std::vector< bool > > ( const ExecuteServiceArgument & arg)

Definition at line 16 of file user_services.cpp.

◆ get_execute_arg_value< std::vector< float > >()

template<>
std::vector< float > esphome::api::get_execute_arg_value< std::vector< float > > ( const ExecuteServiceArgument & arg)

Definition at line 16 of file user_services.cpp.

◆ get_execute_arg_value< std::vector< int32_t > >()

template<>
std::vector< int32_t > esphome::api::get_execute_arg_value< std::vector< int32_t > > ( const ExecuteServiceArgument & arg)

Definition at line 16 of file user_services.cpp.

◆ get_execute_arg_value< std::vector< std::string > >()

template<>
std::vector< std::string > esphome::api::get_execute_arg_value< std::vector< std::string > > ( const ExecuteServiceArgument & arg)

Definition at line 16 of file user_services.cpp.

◆ get_execute_arg_value< StringRef >()

Definition at line 16 of file user_services.cpp.

◆ INITIAL_STATE_HANDLER() [1/10]

esphome::api::INITIAL_STATE_HANDLER ( binary_sensor ,
binary_sensor::BinarySensor  )

◆ INITIAL_STATE_HANDLER() [2/10]

cover::Cover esphome::api::INITIAL_STATE_HANDLER ( fan ,
fan::Fan  )

◆ INITIAL_STATE_HANDLER() [3/10]

◆ INITIAL_STATE_HANDLER() [4/10]

◆ INITIAL_STATE_HANDLER() [5/10]

cover::Cover light::LightState switch_::Switch climate::Climate esphome::api::INITIAL_STATE_HANDLER ( number ,
number::Number  )

◆ INITIAL_STATE_HANDLER() [6/10]

cover::Cover light::LightState esphome::api::INITIAL_STATE_HANDLER ( sensor ,
sensor::Sensor  )

◆ INITIAL_STATE_HANDLER() [7/10]

◆ INITIAL_STATE_HANDLER() [8/10]

cover::Cover light::LightState switch_::Switch esphome::api::INITIAL_STATE_HANDLER ( text_sensor ,
text_sensor::TextSensor  )

◆ INITIAL_STATE_HANDLER() [9/10]

◆ INITIAL_STATE_HANDLER() [10/10]

◆ LIST_ENTITIES_HANDLER() [1/12]

esphome::api::LIST_ENTITIES_HANDLER ( binary_sensor ,
binary_sensor::BinarySensor ,
ListEntitiesBinarySensorResponse  )

◆ LIST_ENTITIES_HANDLER() [2/12]

◆ LIST_ENTITIES_HANDLER() [3/12]

◆ LIST_ENTITIES_HANDLER() [4/12]

◆ LIST_ENTITIES_HANDLER() [5/12]

ListEntitiesCoverResponse esphome::api::LIST_ENTITIES_HANDLER ( fan ,
fan::Fan ,
ListEntitiesFanResponse  )

◆ LIST_ENTITIES_HANDLER() [6/12]

◆ LIST_ENTITIES_HANDLER() [7/12]

◆ LIST_ENTITIES_HANDLER() [8/12]

◆ LIST_ENTITIES_HANDLER() [9/12]

◆ LIST_ENTITIES_HANDLER() [10/12]

◆ LIST_ENTITIES_HANDLER() [11/12]

◆ LIST_ENTITIES_HANDLER() [12/12]

◆ make_buffer()

std::unique_ptr< uint8_t[]> esphome::api::make_buffer ( size_t n)
inline

Helper to use make_unique_for_overwrite where available (skips zero-fill), falling back to make_unique on older GCC (ESP8266, LibreTiny).

Definition at line 14 of file api_buffer.h.

◆ noise_err_to_logstr()

const LogString * esphome::api::noise_err_to_logstr ( int err)

Convert a noise error code to a readable error.

Definition at line 62 of file api_frame_helper_noise.cpp.

◆ noise_rand_bytes()

void esphome::api::noise_rand_bytes ( void * output,
size_t len )

Definition at line 629 of file api_frame_helper_noise.cpp.

◆ proto_encode_msg()

template<typename T >
void esphome::api::proto_encode_msg ( const void * msg,
ProtoWriteBuffer & buf )

Definition at line 672 of file proto.h.

◆ proto_enum_to_string()

template<typename T >
const char * esphome::api::proto_enum_to_string ( T value)

◆ proto_enum_to_string< enums::AlarmControlPanelState >()

◆ proto_enum_to_string< enums::AlarmControlPanelStateCommand >()

◆ proto_enum_to_string< enums::BluetoothDeviceRequestType >()

◆ proto_enum_to_string< enums::BluetoothScannerMode >()

◆ proto_enum_to_string< enums::BluetoothScannerState >()

◆ proto_enum_to_string< enums::ClimateAction >()

Definition at line 336 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ClimateFanMode >()

Definition at line 296 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ClimateMode >()

Definition at line 276 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ClimatePreset >()

Definition at line 356 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ClimateSwingMode >()

Definition at line 322 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ColorMode >()

Definition at line 154 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::CoverOperation >()

Definition at line 128 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::DSTRuleType >()

Definition at line 223 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::EntityCategory >()

Definition at line 115 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::FanDirection >()

Definition at line 142 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::LockCommand >()

Definition at line 457 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::LockState >()

Definition at line 439 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::LogLevel >()

Definition at line 201 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::MediaPlayerCommand >()

Definition at line 491 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::MediaPlayerFormatPurpose >()

◆ proto_enum_to_string< enums::MediaPlayerState >()

Definition at line 471 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::NumberMode >()

Definition at line 425 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::SensorStateClass >()

Definition at line 184 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::SerialProxyParity >()

Definition at line 768 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::SerialProxyPortType >()

Definition at line 103 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::SerialProxyRequestType >()

◆ proto_enum_to_string< enums::SerialProxyStatus >()

Definition at line 792 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ServiceArgType >()

Definition at line 238 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::SupportsResponseType >()

◆ proto_enum_to_string< enums::TextMode >()

Definition at line 714 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::UpdateCommand >()

Definition at line 740 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ValveOperation >()

Definition at line 726 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::VoiceAssistantEvent >()

Definition at line 611 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::VoiceAssistantRequestFlag >()

◆ proto_enum_to_string< enums::VoiceAssistantSubscribeFlag >()

◆ proto_enum_to_string< enums::VoiceAssistantTimerEvent >()

◆ proto_enum_to_string< enums::WaterHeaterCommandHasField >()

◆ proto_enum_to_string< enums::WaterHeaterMode >()

Definition at line 380 of file api_pb2_dump.cpp.

◆ proto_enum_to_string< enums::ZWaveProxyRequestType >()

◆ to_service_arg_type()

template<typename T >
enums::ServiceArgType esphome::api::to_service_arg_type ( )

◆ to_service_arg_type< bool >()

Definition at line 63 of file user_services.cpp.

◆ to_service_arg_type< const FixedVector< bool > & >()

Definition at line 83 of file user_services.cpp.

◆ to_service_arg_type< const FixedVector< float > & >()

Definition at line 89 of file user_services.cpp.

◆ to_service_arg_type< const FixedVector< int32_t > & >()

Definition at line 86 of file user_services.cpp.

◆ to_service_arg_type< const FixedVector< std::string > & >()

template<>
enums::ServiceArgType esphome::api::to_service_arg_type< const FixedVector< std::string > & > ( )

Definition at line 92 of file user_services.cpp.

◆ to_service_arg_type< float >()

Definition at line 65 of file user_services.cpp.

◆ to_service_arg_type< int32_t >()

Definition at line 64 of file user_services.cpp.

◆ to_service_arg_type< std::string >()

Definition at line 66 of file user_services.cpp.

◆ to_service_arg_type< std::vector< bool > >()

template<>
enums::ServiceArgType esphome::api::to_service_arg_type< std::vector< bool > > ( )

Definition at line 71 of file user_services.cpp.

◆ to_service_arg_type< std::vector< float > >()

template<>
enums::ServiceArgType esphome::api::to_service_arg_type< std::vector< float > > ( )

Definition at line 75 of file user_services.cpp.

◆ to_service_arg_type< std::vector< int32_t > >()

template<>
enums::ServiceArgType esphome::api::to_service_arg_type< std::vector< int32_t > > ( )

Definition at line 72 of file user_services.cpp.

◆ to_service_arg_type< std::vector< std::string > >()

template<>
enums::ServiceArgType esphome::api::to_service_arg_type< std::vector< std::string > > ( )

Definition at line 78 of file user_services.cpp.

◆ to_service_arg_type< StringRef >()

Variable Documentation

◆ global_api_server

APIServer * esphome::api::global_api_server = nullptr

Definition at line 29 of file api_server.cpp.

◆ PACKED

struct esphome::api::SavedNoisePsk esphome::api::PACKED

◆ PROTO_VARINT_PARSE_FAILED

uint32_t esphome::api::PROTO_VARINT_PARSE_FAILED = 0
inlineconstexpr

Sentinel value for consumed field indicating parse failure.

Definition at line 110 of file proto.h.

◆ WIRE_TYPE_FIXED32

uint8_t esphome::api::WIRE_TYPE_FIXED32 = 5
constexpr

Definition at line 24 of file proto.h.

◆ WIRE_TYPE_LENGTH_DELIMITED

uint8_t esphome::api::WIRE_TYPE_LENGTH_DELIMITED = 2
constexpr

Definition at line 23 of file proto.h.

◆ WIRE_TYPE_MASK

uint8_t esphome::api::WIRE_TYPE_MASK = 0b111
constexpr

Definition at line 25 of file proto.h.

◆ WIRE_TYPE_VARINT

uint8_t esphome::api::WIRE_TYPE_VARINT = 0
constexpr

Definition at line 22 of file proto.h.