ESPHome  2024.3.1
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
esphome::api Namespace Reference

Namespaces

 enums
 

Data Structures

class  AlarmControlPanelCommandRequest
 
class  AlarmControlPanelStateResponse
 
class  APIConnectedCondition
 
class  APIConnection
 
class  APIFrameHelper
 
class  APINoiseContext
 
class  APINoiseFrameHelper
 
class  APIPlaintextFrameHelper
 
class  APIServer
 
class  APIServerConnection
 
class  APIServerConnectionBase
 
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  BluetoothLEAdvertisementResponse
 
class  BluetoothLERawAdvertisement
 
class  BluetoothLERawAdvertisementsResponse
 
class  BluetoothServiceData
 
class  ButtonCommandRequest
 
class  CameraImageRequest
 
class  CameraImageResponse
 
class  ClimateCommandRequest
 
class  ClimateStateResponse
 
class  ConnectRequest
 
class  ConnectResponse
 
class  CoverCommandRequest
 
class  CoverStateResponse
 
class  CustomAPIDevice
 
class  CustomAPIDeviceService
 
class  DateCommandRequest
 
class  DateStateResponse
 
class  DeviceInfoRequest
 
class  DeviceInfoResponse
 
class  DisconnectRequest
 
class  DisconnectResponse
 
class  ExecuteServiceArgument
 
class  ExecuteServiceRequest
 
class  FanCommandRequest
 
class  FanStateResponse
 
class  GetTimeRequest
 
class  GetTimeResponse
 
class  HelloRequest
 
class  HelloResponse
 
class  HomeAssistantServiceCallAction
 
class  HomeassistantServiceMap
 
class  HomeassistantServiceResponse
 
class  HomeAssistantStateResponse
 
class  InitialStateIterator
 
class  LightCommandRequest
 
class  LightStateResponse
 
class  ListEntitiesAlarmControlPanelResponse
 
class  ListEntitiesBinarySensorResponse
 
class  ListEntitiesButtonResponse
 
class  ListEntitiesCameraResponse
 
class  ListEntitiesClimateResponse
 
class  ListEntitiesCoverResponse
 
class  ListEntitiesDateResponse
 
class  ListEntitiesDoneResponse
 
class  ListEntitiesFanResponse
 
class  ListEntitiesIterator
 
class  ListEntitiesLightResponse
 
class  ListEntitiesLockResponse
 
class  ListEntitiesMediaPlayerResponse
 
class  ListEntitiesNumberResponse
 
class  ListEntitiesRequest
 
class  ListEntitiesSelectResponse
 
class  ListEntitiesSensorResponse
 
class  ListEntitiesServicesArgument
 
class  ListEntitiesServicesResponse
 
class  ListEntitiesSwitchResponse
 
class  ListEntitiesTextResponse
 
class  ListEntitiesTextSensorResponse
 
class  LockCommandRequest
 
class  LockStateResponse
 
class  MediaPlayerCommandRequest
 
class  MediaPlayerStateResponse
 
class  NumberCommandRequest
 
class  NumberStateResponse
 
struct  PacketBuffer
 
class  PingRequest
 
class  PingResponse
 
class  Proto32Bit
 
class  Proto64Bit
 
class  ProtoLengthDelimited
 
class  ProtoMessage
 
class  ProtoService
 
class  ProtoVarInt
 Representation of a VarInt - in ProtoBuf should be 64bit but we only use 32bit. More...
 
class  ProtoWriteBuffer
 
struct  ReadPacketBuffer
 
class  SelectCommandRequest
 
class  SelectStateResponse
 
class  SensorStateResponse
 
class  SubscribeBluetoothConnectionsFreeRequest
 
class  SubscribeBluetoothLEAdvertisementsRequest
 
class  SubscribeHomeassistantServicesRequest
 
class  SubscribeHomeAssistantStateResponse
 
class  SubscribeHomeAssistantStatesRequest
 
class  SubscribeLogsRequest
 
class  SubscribeLogsResponse
 
class  SubscribeStatesRequest
 
class  SubscribeVoiceAssistantRequest
 
class  SwitchCommandRequest
 
class  SwitchStateResponse
 
class  TemplatableKeyValuePair
 
class  TemplatableStringValue
 
class  TextCommandRequest
 
class  TextSensorStateResponse
 
class  TextStateResponse
 
class  UnsubscribeBluetoothLEAdvertisementsRequest
 
class  UserServiceBase
 
class  UserServiceDescriptor
 
class  UserServiceTrigger
 
class  VoiceAssistantAudioSettings
 
class  VoiceAssistantEventData
 
class  VoiceAssistantEventResponse
 
class  VoiceAssistantRequest
 
class  VoiceAssistantResponse
 

Typedefs

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

Enumerations

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

Functions

std::string get_default_unique_id (const std::string &component_type, EntityBase *entity)
 
bool is_would_block (ssize_t ret)
 Is the given return value (from write syscalls) a wouldblock error? More...
 
const char * api_error_to_str (APIError err)
 
std::string noise_err_to_str (int err)
 Convert a noise error code to a readable error. More...
 
void noise_rand_bytes (void *output, size_t len)
 
template<>
const char * proto_enum_to_string< enums::EntityCategory > (enums::EntityCategory value)
 
template<>
const char * proto_enum_to_string< enums::LegacyCoverState > (enums::LegacyCoverState value)
 
template<>
const char * proto_enum_to_string< enums::CoverOperation > (enums::CoverOperation value)
 
template<>
const char * proto_enum_to_string< enums::LegacyCoverCommand > (enums::LegacyCoverCommand value)
 
template<>
const char * proto_enum_to_string< enums::FanSpeed > (enums::FanSpeed 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::SensorLastResetType > (enums::SensorLastResetType value)
 
template<>
const char * proto_enum_to_string< enums::LogLevel > (enums::LogLevel value)
 
template<>
const char * proto_enum_to_string< enums::ServiceArgType > (enums::ServiceArgType 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::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::BluetoothDeviceRequestType > (enums::BluetoothDeviceRequestType 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::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<typename T >
const char * proto_enum_to_string (T value)
 
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<>
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<>
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< 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<typename T >
get_execute_arg_value (const ExecuteServiceArgument &arg)
 
template<typename T >
enums::ServiceArgType to_service_arg_type ()
 

Variables

APIServerglobal_api_server = nullptr
 

Typedef Documentation

◆ psk_t

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

Definition at line 10 of file api_noise_context.h.

Enumeration Type Documentation

◆ APIError

enum esphome::api::APIError : int
strong
Enumerator
OK 
WOULD_BLOCK 
BAD_HANDSHAKE_PACKET_LEN 
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 
HANDSHAKESTATE_READ_FAILED 
HANDSHAKESTATE_WRITE_FAILED 
HANDSHAKESTATE_BAD_STATE 
CIPHERSTATE_DECRYPT_FAILED 
CIPHERSTATE_ENCRYPT_FAILED 
OUT_OF_MEMORY 
HANDSHAKESTATE_SETUP_FAILED 
HANDSHAKESTATE_SPLIT_FAILED 
BAD_HANDSHAKE_ERROR_BYTE 
CONNECTION_CLOSED 

Definition at line 33 of file api_frame_helper.h.

Function Documentation

◆ api_error_to_str()

const char * esphome::api::api_error_to_str ( APIError  err)

Definition at line 23 of file api_frame_helper.cpp.

◆ get_default_unique_id()

std::string esphome::api::get_default_unique_id ( const std::string &  component_type,
EntityBase entity 
)

Definition at line 189 of file api_connection.cpp.

◆ 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< 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 15 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 21 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 18 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 24 of file user_services.cpp.

◆ is_would_block()

bool esphome::api::is_would_block ( ssize_t  ret)

Is the given return value (from write syscalls) a wouldblock error?

Definition at line 16 of file api_frame_helper.cpp.

◆ noise_err_to_str()

std::string esphome::api::noise_err_to_str ( int  err)

Convert a noise error code to a readable error.

Definition at line 83 of file api_frame_helper.cpp.

◆ noise_rand_bytes()

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

Definition at line 736 of file api_frame_helper.cpp.

◆ proto_enum_to_string()

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

◆ proto_enum_to_string< enums::AlarmControlPanelState >()

Definition at line 465 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::AlarmControlPanelStateCommand >()

Definition at line 494 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::BluetoothDeviceRequestType >()

Definition at line 391 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ClimateAction >()

Definition at line 264 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ClimateFanMode >()

Definition at line 220 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ClimateMode >()

Definition at line 198 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ClimatePreset >()

Definition at line 284 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ClimateSwingMode >()

Definition at line 248 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ColorMode >()

Definition at line 92 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::CoverOperation >()

Definition at line 38 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::EntityCategory >()

Definition at line 12 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::FanDirection >()

Definition at line 80 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::FanSpeed >()

Definition at line 66 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::LegacyCoverCommand >()

Definition at line 52 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::LegacyCoverState >()

Definition at line 26 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::LockCommand >()

Definition at line 342 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::LockState >()

Definition at line 322 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::LogLevel >()

Definition at line 150 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::MediaPlayerCommand >()

Definition at line 372 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::MediaPlayerState >()

Definition at line 356 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::NumberMode >()

Definition at line 308 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::SensorLastResetType >()

Definition at line 136 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::SensorStateClass >()

Definition at line 120 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::ServiceArgType >()

Definition at line 174 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::TextMode >()

Definition at line 516 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::VoiceAssistantEvent >()

Definition at line 427 of file api_pb2.cpp.

◆ proto_enum_to_string< enums::VoiceAssistantRequestFlag >()

Definition at line 413 of file api_pb2.cpp.

◆ to_service_arg_type()

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

◆ to_service_arg_type< bool >()

Definition at line 28 of file user_services.cpp.

◆ to_service_arg_type< float >()

Definition at line 30 of file user_services.cpp.

◆ to_service_arg_type< int32_t >()

Definition at line 29 of file user_services.cpp.

◆ to_service_arg_type< std::string >()

Definition at line 31 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 32 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 36 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 33 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 39 of file user_services.cpp.

Variable Documentation

◆ global_api_server

APIServer * esphome::api::global_api_server = nullptr

Definition at line 305 of file api_server.cpp.