ESPHome  2024.9.2
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
esphome::api::APIConnection Class Reference

#include <api_connection.h>

Inheritance diagram for esphome::api::APIConnection:
esphome::api::APIServerConnection esphome::api::APIServerConnectionBase esphome::api::ProtoService

Public Member Functions

 APIConnection (std::unique_ptr< socket::Socket > socket, APIServer *parent)
 
virtual ~APIConnection ()
 
void start ()
 
void loop ()
 
bool send_list_info_done ()
 
bool send_binary_sensor_state (binary_sensor::BinarySensor *binary_sensor, bool state)
 
bool send_binary_sensor_info (binary_sensor::BinarySensor *binary_sensor)
 
bool send_cover_state (cover::Cover *cover)
 
bool send_cover_info (cover::Cover *cover)
 
void cover_command (const CoverCommandRequest &msg) override
 
bool send_fan_state (fan::Fan *fan)
 
bool send_fan_info (fan::Fan *fan)
 
void fan_command (const FanCommandRequest &msg) override
 
bool send_light_state (light::LightState *light)
 
bool send_light_info (light::LightState *light)
 
void light_command (const LightCommandRequest &msg) override
 
bool send_sensor_state (sensor::Sensor *sensor, float state)
 
bool send_sensor_info (sensor::Sensor *sensor)
 
bool send_switch_state (switch_::Switch *a_switch, bool state)
 
bool send_switch_info (switch_::Switch *a_switch)
 
void switch_command (const SwitchCommandRequest &msg) override
 
bool send_text_sensor_state (text_sensor::TextSensor *text_sensor, std::string state)
 
bool send_text_sensor_info (text_sensor::TextSensor *text_sensor)
 
void send_camera_state (std::shared_ptr< esp32_camera::CameraImage > image)
 
bool send_camera_info (esp32_camera::ESP32Camera *camera)
 
void camera_image (const CameraImageRequest &msg) override
 
bool send_climate_state (climate::Climate *climate)
 
bool send_climate_info (climate::Climate *climate)
 
void climate_command (const ClimateCommandRequest &msg) override
 
bool send_number_state (number::Number *number, float state)
 
bool send_number_info (number::Number *number)
 
void number_command (const NumberCommandRequest &msg) override
 
bool send_date_state (datetime::DateEntity *date)
 
bool send_date_info (datetime::DateEntity *date)
 
void date_command (const DateCommandRequest &msg) override
 
bool send_time_state (datetime::TimeEntity *time)
 
bool send_time_info (datetime::TimeEntity *time)
 
void time_command (const TimeCommandRequest &msg) override
 
bool send_datetime_state (datetime::DateTimeEntity *datetime)
 
bool send_datetime_info (datetime::DateTimeEntity *datetime)
 
void datetime_command (const DateTimeCommandRequest &msg) override
 
bool send_text_state (text::Text *text, std::string state)
 
bool send_text_info (text::Text *text)
 
void text_command (const TextCommandRequest &msg) override
 
bool send_select_state (select::Select *select, std::string state)
 
bool send_select_info (select::Select *select)
 
void select_command (const SelectCommandRequest &msg) override
 
bool send_button_info (button::Button *button)
 
void button_command (const ButtonCommandRequest &msg) override
 
bool send_lock_state (lock::Lock *a_lock, lock::LockState state)
 
bool send_lock_info (lock::Lock *a_lock)
 
void lock_command (const LockCommandRequest &msg) override
 
bool send_valve_state (valve::Valve *valve)
 
bool send_valve_info (valve::Valve *valve)
 
void valve_command (const ValveCommandRequest &msg) override
 
bool send_media_player_state (media_player::MediaPlayer *media_player)
 
bool send_media_player_info (media_player::MediaPlayer *media_player)
 
void media_player_command (const MediaPlayerCommandRequest &msg) override
 
bool send_log_message (int level, const char *tag, const char *line)
 
void send_homeassistant_service_call (const HomeassistantServiceResponse &call)
 
void subscribe_bluetooth_le_advertisements (const SubscribeBluetoothLEAdvertisementsRequest &msg) override
 
void unsubscribe_bluetooth_le_advertisements (const UnsubscribeBluetoothLEAdvertisementsRequest &msg) override
 
bool send_bluetooth_le_advertisement (const BluetoothLEAdvertisementResponse &msg)
 
void bluetooth_device_request (const BluetoothDeviceRequest &msg) override
 
void bluetooth_gatt_read (const BluetoothGATTReadRequest &msg) override
 
void bluetooth_gatt_write (const BluetoothGATTWriteRequest &msg) override
 
void bluetooth_gatt_read_descriptor (const BluetoothGATTReadDescriptorRequest &msg) override
 
void bluetooth_gatt_write_descriptor (const BluetoothGATTWriteDescriptorRequest &msg) override
 
void bluetooth_gatt_get_services (const BluetoothGATTGetServicesRequest &msg) override
 
void bluetooth_gatt_notify (const BluetoothGATTNotifyRequest &msg) override
 
BluetoothConnectionsFreeResponse subscribe_bluetooth_connections_free (const SubscribeBluetoothConnectionsFreeRequest &msg) override
 
void send_time_request ()
 
void subscribe_voice_assistant (const SubscribeVoiceAssistantRequest &msg) override
 
void on_voice_assistant_response (const VoiceAssistantResponse &msg) override
 
void on_voice_assistant_event_response (const VoiceAssistantEventResponse &msg) override
 
void on_voice_assistant_audio (const VoiceAssistantAudio &msg) override
 
void on_voice_assistant_timer_event_response (const VoiceAssistantTimerEventResponse &msg) override
 
void on_voice_assistant_announce_request (const VoiceAssistantAnnounceRequest &msg) override
 
VoiceAssistantConfigurationResponse voice_assistant_get_configuration (const VoiceAssistantConfigurationRequest &msg) override
 
void voice_assistant_set_configuration (const VoiceAssistantSetConfiguration &msg) override
 
bool send_alarm_control_panel_state (alarm_control_panel::AlarmControlPanel *a_alarm_control_panel)
 
bool send_alarm_control_panel_info (alarm_control_panel::AlarmControlPanel *a_alarm_control_panel)
 
void alarm_control_panel_command (const AlarmControlPanelCommandRequest &msg) override
 
bool send_event (event::Event *event, std::string event_type)
 
bool send_event_info (event::Event *event)
 
bool send_update_state (update::UpdateEntity *update)
 
bool send_update_info (update::UpdateEntity *update)
 
void update_command (const UpdateCommandRequest &msg) override
 
void on_disconnect_response (const DisconnectResponse &value) override
 
void on_ping_response (const PingResponse &value) override
 
void on_home_assistant_state_response (const HomeAssistantStateResponse &msg) override
 
void on_get_time_response (const GetTimeResponse &value) override
 
HelloResponse hello (const HelloRequest &msg) override
 
ConnectResponse connect (const ConnectRequest &msg) override
 
DisconnectResponse disconnect (const DisconnectRequest &msg) override
 
PingResponse ping (const PingRequest &msg) override
 
DeviceInfoResponse device_info (const DeviceInfoRequest &msg) override
 
void list_entities (const ListEntitiesRequest &msg) override
 
void subscribe_states (const SubscribeStatesRequest &msg) override
 
void subscribe_logs (const SubscribeLogsRequest &msg) override
 
void subscribe_homeassistant_services (const SubscribeHomeassistantServicesRequest &msg) override
 
void subscribe_home_assistant_states (const SubscribeHomeAssistantStatesRequest &msg) override
 
GetTimeResponse get_time (const GetTimeRequest &msg) override
 
void execute_service (const ExecuteServiceRequest &msg) override
 
bool is_authenticated () override
 
bool is_connection_setup () override
 
void on_fatal_error () override
 
void on_unauthenticated_access () override
 
void on_no_setup_connection () override
 
ProtoWriteBuffer create_buffer () override
 
bool send_buffer (ProtoWriteBuffer buffer, uint32_t message_type) override
 
std::string get_client_combined_info () const
 
- Public Member Functions inherited from esphome::api::APIServerConnectionBase
bool send_hello_response (const HelloResponse &msg)
 
bool send_connect_response (const ConnectResponse &msg)
 
bool send_disconnect_request (const DisconnectRequest &msg)
 
bool send_disconnect_response (const DisconnectResponse &msg)
 
bool send_ping_request (const PingRequest &msg)
 
bool send_ping_response (const PingResponse &msg)
 
bool send_device_info_response (const DeviceInfoResponse &msg)
 
bool send_list_entities_done_response (const ListEntitiesDoneResponse &msg)
 
bool send_list_entities_binary_sensor_response (const ListEntitiesBinarySensorResponse &msg)
 
bool send_binary_sensor_state_response (const BinarySensorStateResponse &msg)
 
bool send_list_entities_cover_response (const ListEntitiesCoverResponse &msg)
 
bool send_cover_state_response (const CoverStateResponse &msg)
 
bool send_list_entities_fan_response (const ListEntitiesFanResponse &msg)
 
bool send_fan_state_response (const FanStateResponse &msg)
 
bool send_list_entities_light_response (const ListEntitiesLightResponse &msg)
 
bool send_light_state_response (const LightStateResponse &msg)
 
bool send_list_entities_sensor_response (const ListEntitiesSensorResponse &msg)
 
bool send_sensor_state_response (const SensorStateResponse &msg)
 
bool send_list_entities_switch_response (const ListEntitiesSwitchResponse &msg)
 
bool send_switch_state_response (const SwitchStateResponse &msg)
 
bool send_list_entities_text_sensor_response (const ListEntitiesTextSensorResponse &msg)
 
bool send_text_sensor_state_response (const TextSensorStateResponse &msg)
 
bool send_subscribe_logs_response (const SubscribeLogsResponse &msg)
 
bool send_homeassistant_service_response (const HomeassistantServiceResponse &msg)
 
bool send_subscribe_home_assistant_state_response (const SubscribeHomeAssistantStateResponse &msg)
 
bool send_get_time_request (const GetTimeRequest &msg)
 
bool send_get_time_response (const GetTimeResponse &msg)
 
bool send_list_entities_services_response (const ListEntitiesServicesResponse &msg)
 
bool send_list_entities_camera_response (const ListEntitiesCameraResponse &msg)
 
bool send_camera_image_response (const CameraImageResponse &msg)
 
bool send_list_entities_climate_response (const ListEntitiesClimateResponse &msg)
 
bool send_climate_state_response (const ClimateStateResponse &msg)
 
bool send_list_entities_number_response (const ListEntitiesNumberResponse &msg)
 
bool send_number_state_response (const NumberStateResponse &msg)
 
bool send_list_entities_select_response (const ListEntitiesSelectResponse &msg)
 
bool send_select_state_response (const SelectStateResponse &msg)
 
bool send_list_entities_lock_response (const ListEntitiesLockResponse &msg)
 
bool send_lock_state_response (const LockStateResponse &msg)
 
bool send_list_entities_button_response (const ListEntitiesButtonResponse &msg)
 
bool send_list_entities_media_player_response (const ListEntitiesMediaPlayerResponse &msg)
 
bool send_media_player_state_response (const MediaPlayerStateResponse &msg)
 
bool send_bluetooth_le_advertisement_response (const BluetoothLEAdvertisementResponse &msg)
 
bool send_bluetooth_le_raw_advertisements_response (const BluetoothLERawAdvertisementsResponse &msg)
 
bool send_bluetooth_device_connection_response (const BluetoothDeviceConnectionResponse &msg)
 
bool send_bluetooth_gatt_get_services_response (const BluetoothGATTGetServicesResponse &msg)
 
bool send_bluetooth_gatt_get_services_done_response (const BluetoothGATTGetServicesDoneResponse &msg)
 
bool send_bluetooth_gatt_read_response (const BluetoothGATTReadResponse &msg)
 
bool send_bluetooth_gatt_notify_data_response (const BluetoothGATTNotifyDataResponse &msg)
 
bool send_bluetooth_connections_free_response (const BluetoothConnectionsFreeResponse &msg)
 
bool send_bluetooth_gatt_error_response (const BluetoothGATTErrorResponse &msg)
 
bool send_bluetooth_gatt_write_response (const BluetoothGATTWriteResponse &msg)
 
bool send_bluetooth_gatt_notify_response (const BluetoothGATTNotifyResponse &msg)
 
bool send_bluetooth_device_pairing_response (const BluetoothDevicePairingResponse &msg)
 
bool send_bluetooth_device_unpairing_response (const BluetoothDeviceUnpairingResponse &msg)
 
bool send_bluetooth_device_clear_cache_response (const BluetoothDeviceClearCacheResponse &msg)
 
bool send_voice_assistant_request (const VoiceAssistantRequest &msg)
 
bool send_voice_assistant_audio (const VoiceAssistantAudio &msg)
 
bool send_voice_assistant_announce_finished (const VoiceAssistantAnnounceFinished &msg)
 
bool send_voice_assistant_configuration_response (const VoiceAssistantConfigurationResponse &msg)
 
bool send_list_entities_alarm_control_panel_response (const ListEntitiesAlarmControlPanelResponse &msg)
 
bool send_alarm_control_panel_state_response (const AlarmControlPanelStateResponse &msg)
 
bool send_list_entities_text_response (const ListEntitiesTextResponse &msg)
 
bool send_text_state_response (const TextStateResponse &msg)
 
bool send_list_entities_date_response (const ListEntitiesDateResponse &msg)
 
bool send_date_state_response (const DateStateResponse &msg)
 
bool send_list_entities_time_response (const ListEntitiesTimeResponse &msg)
 
bool send_time_state_response (const TimeStateResponse &msg)
 
bool send_list_entities_event_response (const ListEntitiesEventResponse &msg)
 
bool send_event_response (const EventResponse &msg)
 
bool send_list_entities_valve_response (const ListEntitiesValveResponse &msg)
 
bool send_valve_state_response (const ValveStateResponse &msg)
 
bool send_list_entities_date_time_response (const ListEntitiesDateTimeResponse &msg)
 
bool send_date_time_state_response (const DateTimeStateResponse &msg)
 
bool send_list_entities_update_response (const ListEntitiesUpdateResponse &msg)
 
bool send_update_state_response (const UpdateStateResponse &msg)
 

Protected Types

enum  ConnectionState { ConnectionState::WAITING_FOR_HELLO, ConnectionState::CONNECTED, ConnectionState::AUTHENTICATED }
 

Protected Member Functions

bool send_ (const void *buf, size_t len, bool force)
 
- Protected Member Functions inherited from esphome::api::APIServerConnection
void on_hello_request (const HelloRequest &msg) override
 
void on_connect_request (const ConnectRequest &msg) override
 
void on_disconnect_request (const DisconnectRequest &msg) override
 
void on_ping_request (const PingRequest &msg) override
 
void on_device_info_request (const DeviceInfoRequest &msg) override
 
void on_list_entities_request (const ListEntitiesRequest &msg) override
 
void on_subscribe_states_request (const SubscribeStatesRequest &msg) override
 
void on_subscribe_logs_request (const SubscribeLogsRequest &msg) override
 
void on_subscribe_homeassistant_services_request (const SubscribeHomeassistantServicesRequest &msg) override
 
void on_subscribe_home_assistant_states_request (const SubscribeHomeAssistantStatesRequest &msg) override
 
void on_get_time_request (const GetTimeRequest &msg) override
 
void on_execute_service_request (const ExecuteServiceRequest &msg) override
 
void on_cover_command_request (const CoverCommandRequest &msg) override
 
void on_fan_command_request (const FanCommandRequest &msg) override
 
void on_light_command_request (const LightCommandRequest &msg) override
 
void on_switch_command_request (const SwitchCommandRequest &msg) override
 
void on_camera_image_request (const CameraImageRequest &msg) override
 
void on_climate_command_request (const ClimateCommandRequest &msg) override
 
void on_number_command_request (const NumberCommandRequest &msg) override
 
void on_text_command_request (const TextCommandRequest &msg) override
 
void on_select_command_request (const SelectCommandRequest &msg) override
 
void on_button_command_request (const ButtonCommandRequest &msg) override
 
void on_lock_command_request (const LockCommandRequest &msg) override
 
void on_valve_command_request (const ValveCommandRequest &msg) override
 
void on_media_player_command_request (const MediaPlayerCommandRequest &msg) override
 
void on_date_command_request (const DateCommandRequest &msg) override
 
void on_time_command_request (const TimeCommandRequest &msg) override
 
void on_date_time_command_request (const DateTimeCommandRequest &msg) override
 
void on_update_command_request (const UpdateCommandRequest &msg) override
 
void on_subscribe_bluetooth_le_advertisements_request (const SubscribeBluetoothLEAdvertisementsRequest &msg) override
 
void on_bluetooth_device_request (const BluetoothDeviceRequest &msg) override
 
void on_bluetooth_gatt_get_services_request (const BluetoothGATTGetServicesRequest &msg) override
 
void on_bluetooth_gatt_read_request (const BluetoothGATTReadRequest &msg) override
 
void on_bluetooth_gatt_write_request (const BluetoothGATTWriteRequest &msg) override
 
void on_bluetooth_gatt_read_descriptor_request (const BluetoothGATTReadDescriptorRequest &msg) override
 
void on_bluetooth_gatt_write_descriptor_request (const BluetoothGATTWriteDescriptorRequest &msg) override
 
void on_bluetooth_gatt_notify_request (const BluetoothGATTNotifyRequest &msg) override
 
void on_subscribe_bluetooth_connections_free_request (const SubscribeBluetoothConnectionsFreeRequest &msg) override
 
void on_unsubscribe_bluetooth_le_advertisements_request (const UnsubscribeBluetoothLEAdvertisementsRequest &msg) override
 
void on_subscribe_voice_assistant_request (const SubscribeVoiceAssistantRequest &msg) override
 
void on_voice_assistant_configuration_request (const VoiceAssistantConfigurationRequest &msg) override
 
void on_voice_assistant_set_configuration (const VoiceAssistantSetConfiguration &msg) override
 
void on_alarm_control_panel_command_request (const AlarmControlPanelCommandRequest &msg) override
 
- Protected Member Functions inherited from esphome::api::APIServerConnectionBase
bool read_message (uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override
 
- Protected Member Functions inherited from esphome::api::ProtoService
template<class C >
bool send_message_ (const C &msg, uint32_t message_type)
 

Protected Attributes

friend APIServer
 
enum esphome::api::APIConnection::ConnectionState WAITING_FOR_HELLO
 
bool remove_ {false}
 
std::vector< uint8_t > proto_write_buffer_
 
std::unique_ptr< APIFrameHelperhelper_
 
std::string client_info_
 
std::string client_peername_
 
std::string client_combined_info_
 
uint32_t client_api_version_major_ {0}
 
uint32_t client_api_version_minor_ {0}
 
esp32_camera::CameraImageReader image_reader_
 
bool state_subscription_ {false}
 
int log_subscription_ {ESPHOME_LOG_LEVEL_NONE}
 
uint32_t last_traffic_
 
uint32_t next_ping_retry_ {0}
 
uint8_t ping_retries_ {0}
 
bool sent_ping_ {false}
 
bool service_call_subscription_ {false}
 
bool next_close_ = false
 
APIServerparent_
 
InitialStateIterator initial_state_iterator_
 
ListEntitiesIterator list_entities_iterator_
 
int state_subs_at_ = -1
 

Detailed Description

Definition at line 16 of file api_connection.h.

Member Enumeration Documentation

◆ ConnectionState

Enumerator
WAITING_FOR_HELLO 
CONNECTED 
AUTHENTICATED 

Definition at line 233 of file api_connection.h.

Constructor & Destructor Documentation

◆ APIConnection()

esphome::api::APIConnection::APIConnection ( std::unique_ptr< socket::Socket socket,
APIServer parent 
)

Definition at line 30 of file api_connection.cpp.

◆ ~APIConnection()

esphome::api::APIConnection::~APIConnection ( )
virtual

Definition at line 57 of file api_connection.cpp.

Member Function Documentation

◆ alarm_control_panel_command()

void esphome::api::APIConnection::alarm_control_panel_command ( const AlarmControlPanelCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1289 of file api_connection.cpp.

◆ bluetooth_device_request()

void esphome::api::APIConnection::bluetooth_device_request ( const BluetoothDeviceRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1130 of file api_connection.cpp.

◆ bluetooth_gatt_get_services()

void esphome::api::APIConnection::bluetooth_gatt_get_services ( const BluetoothGATTGetServicesRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1145 of file api_connection.cpp.

◆ bluetooth_gatt_notify()

void esphome::api::APIConnection::bluetooth_gatt_notify ( const BluetoothGATTNotifyRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1149 of file api_connection.cpp.

◆ bluetooth_gatt_read()

void esphome::api::APIConnection::bluetooth_gatt_read ( const BluetoothGATTReadRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1133 of file api_connection.cpp.

◆ bluetooth_gatt_read_descriptor()

void esphome::api::APIConnection::bluetooth_gatt_read_descriptor ( const BluetoothGATTReadDescriptorRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1139 of file api_connection.cpp.

◆ bluetooth_gatt_write()

void esphome::api::APIConnection::bluetooth_gatt_write ( const BluetoothGATTWriteRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1136 of file api_connection.cpp.

◆ bluetooth_gatt_write_descriptor()

void esphome::api::APIConnection::bluetooth_gatt_write_descriptor ( const BluetoothGATTWriteDescriptorRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1142 of file api_connection.cpp.

◆ button_command()

void esphome::api::APIConnection::button_command ( const ButtonCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 904 of file api_connection.cpp.

◆ camera_image()

void esphome::api::APIConnection::camera_image ( const CameraImageRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1085 of file api_connection.cpp.

◆ climate_command()

void esphome::api::APIConnection::climate_command ( const ClimateCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 630 of file api_connection.cpp.

◆ connect()

ConnectResponse esphome::api::APIConnection::connect ( const ConnectRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1438 of file api_connection.cpp.

◆ cover_command()

void esphome::api::APIConnection::cover_command ( const CoverCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 268 of file api_connection.cpp.

◆ create_buffer()

ProtoWriteBuffer esphome::api::APIConnection::create_buffer ( )
inlineoverridevirtual

Implements esphome::api::ProtoService.

Definition at line 219 of file api_connection.h.

◆ date_command()

void esphome::api::APIConnection::date_command ( const DateCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 728 of file api_connection.cpp.

◆ datetime_command()

void esphome::api::APIConnection::datetime_command ( const DateTimeCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 803 of file api_connection.cpp.

◆ device_info()

DeviceInfoResponse esphome::api::APIConnection::device_info ( const DeviceInfoRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1456 of file api_connection.cpp.

◆ disconnect()

DisconnectResponse esphome::api::APIConnection::disconnect ( const DisconnectRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 194 of file api_connection.cpp.

◆ execute_service()

void esphome::api::APIConnection::execute_service ( const ExecuteServiceRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1504 of file api_connection.cpp.

◆ fan_command()

void esphome::api::APIConnection::fan_command ( const FanCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 336 of file api_connection.cpp.

◆ get_client_combined_info()

std::string esphome::api::APIConnection::get_client_combined_info ( ) const
inline

Definition at line 226 of file api_connection.h.

◆ get_time()

GetTimeResponse esphome::api::APIConnection::get_time ( const GetTimeRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 206 of file api_connection.h.

◆ hello()

HelloResponse esphome::api::APIConnection::hello ( const HelloRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1419 of file api_connection.cpp.

◆ is_authenticated()

bool esphome::api::APIConnection::is_authenticated ( )
inlineoverridevirtual

Implements esphome::api::ProtoService.

Definition at line 212 of file api_connection.h.

◆ is_connection_setup()

bool esphome::api::APIConnection::is_connection_setup ( )
inlineoverridevirtual

Implements esphome::api::ProtoService.

Definition at line 213 of file api_connection.h.

◆ light_command()

void esphome::api::APIConnection::light_command ( const LightCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 419 of file api_connection.cpp.

◆ list_entities()

void esphome::api::APIConnection::list_entities ( const ListEntitiesRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 192 of file api_connection.h.

◆ lock_command()

void esphome::api::APIConnection::lock_command ( const LockCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 938 of file api_connection.cpp.

◆ loop()

void esphome::api::APIConnection::loop ( )

Definition at line 70 of file api_connection.cpp.

◆ media_player_command()

void esphome::api::APIConnection::media_player_command ( const MediaPlayerCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1041 of file api_connection.cpp.

◆ number_command()

void esphome::api::APIConnection::number_command ( const NumberCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 691 of file api_connection.cpp.

◆ on_disconnect_response()

void esphome::api::APIConnection::on_disconnect_response ( const DisconnectResponse value)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 203 of file api_connection.cpp.

◆ on_fatal_error()

void esphome::api::APIConnection::on_fatal_error ( )
overridevirtual

Implements esphome::api::ProtoService.

Definition at line 1564 of file api_connection.cpp.

◆ on_get_time_response()

void esphome::api::APIConnection::on_get_time_response ( const GetTimeResponse value)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1102 of file api_connection.cpp.

◆ on_home_assistant_state_response()

void esphome::api::APIConnection::on_home_assistant_state_response ( const HomeAssistantStateResponse msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1497 of file api_connection.cpp.

◆ on_no_setup_connection()

void esphome::api::APIConnection::on_no_setup_connection ( )
overridevirtual

Implements esphome::api::ProtoService.

Definition at line 1560 of file api_connection.cpp.

◆ on_ping_response()

void esphome::api::APIConnection::on_ping_response ( const PingResponse value)
inlineoverridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 178 of file api_connection.h.

◆ on_unauthenticated_access()

void esphome::api::APIConnection::on_unauthenticated_access ( )
overridevirtual

Implements esphome::api::ProtoService.

Definition at line 1556 of file api_connection.cpp.

◆ on_voice_assistant_announce_request()

void esphome::api::APIConnection::on_voice_assistant_announce_request ( const VoiceAssistantAnnounceRequest msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1217 of file api_connection.cpp.

◆ on_voice_assistant_audio()

void esphome::api::APIConnection::on_voice_assistant_audio ( const VoiceAssistantAudio msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1198 of file api_connection.cpp.

◆ on_voice_assistant_event_response()

void esphome::api::APIConnection::on_voice_assistant_event_response ( const VoiceAssistantEventResponse msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1189 of file api_connection.cpp.

◆ on_voice_assistant_response()

void esphome::api::APIConnection::on_voice_assistant_response ( const VoiceAssistantResponse msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1168 of file api_connection.cpp.

◆ on_voice_assistant_timer_event_response()

void esphome::api::APIConnection::on_voice_assistant_timer_event_response ( const VoiceAssistantTimerEventResponse msg)
overridevirtual

Reimplemented from esphome::api::APIServerConnectionBase.

Definition at line 1207 of file api_connection.cpp.

◆ ping()

PingResponse esphome::api::APIConnection::ping ( const PingRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 190 of file api_connection.h.

◆ select_command()

void esphome::api::APIConnection::select_command ( const SelectCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 879 of file api_connection.cpp.

◆ send_()

bool esphome::api::APIConnection::send_ ( const void *  buf,
size_t  len,
bool  force 
)
protected

◆ send_alarm_control_panel_info()

bool esphome::api::APIConnection::send_alarm_control_panel_info ( alarm_control_panel::AlarmControlPanel a_alarm_control_panel)

Definition at line 1275 of file api_connection.cpp.

◆ send_alarm_control_panel_state()

bool esphome::api::APIConnection::send_alarm_control_panel_state ( alarm_control_panel::AlarmControlPanel a_alarm_control_panel)

Definition at line 1266 of file api_connection.cpp.

◆ send_binary_sensor_info()

bool esphome::api::APIConnection::send_binary_sensor_info ( binary_sensor::BinarySensor binary_sensor)

Definition at line 218 of file api_connection.cpp.

◆ send_binary_sensor_state()

bool esphome::api::APIConnection::send_binary_sensor_state ( binary_sensor::BinarySensor binary_sensor,
bool  state 
)

Definition at line 208 of file api_connection.cpp.

◆ send_bluetooth_le_advertisement()

bool esphome::api::APIConnection::send_bluetooth_le_advertisement ( const BluetoothLEAdvertisementResponse msg)

Definition at line 1115 of file api_connection.cpp.

◆ send_buffer()

bool esphome::api::APIConnection::send_buffer ( ProtoWriteBuffer  buffer,
uint32_t  message_type 
)
overridevirtual

Implements esphome::api::ProtoService.

Definition at line 1518 of file api_connection.cpp.

◆ send_button_info()

bool esphome::api::APIConnection::send_button_info ( button::Button button)

Definition at line 891 of file api_connection.cpp.

◆ send_camera_info()

bool esphome::api::APIConnection::send_camera_info ( esp32_camera::ESP32Camera camera)

Definition at line 1073 of file api_connection.cpp.

◆ send_camera_state()

void esphome::api::APIConnection::send_camera_state ( std::shared_ptr< esp32_camera::CameraImage image)

Definition at line 1064 of file api_connection.cpp.

◆ send_climate_info()

bool esphome::api::APIConnection::send_climate_info ( climate::Climate climate)

Definition at line 587 of file api_connection.cpp.

◆ send_climate_state()

bool esphome::api::APIConnection::send_climate_state ( climate::Climate climate)

Definition at line 553 of file api_connection.cpp.

◆ send_cover_info()

bool esphome::api::APIConnection::send_cover_info ( cover::Cover cover)

Definition at line 250 of file api_connection.cpp.

◆ send_cover_state()

bool esphome::api::APIConnection::send_cover_state ( cover::Cover cover)

Definition at line 235 of file api_connection.cpp.

◆ send_date_info()

bool esphome::api::APIConnection::send_date_info ( datetime::DateEntity date)

Definition at line 715 of file api_connection.cpp.

◆ send_date_state()

bool esphome::api::APIConnection::send_date_state ( datetime::DateEntity date)

Definition at line 703 of file api_connection.cpp.

◆ send_datetime_info()

bool esphome::api::APIConnection::send_datetime_info ( datetime::DateTimeEntity datetime)

Definition at line 790 of file api_connection.cpp.

◆ send_datetime_state()

bool esphome::api::APIConnection::send_datetime_state ( datetime::DateTimeEntity datetime)

Definition at line 777 of file api_connection.cpp.

◆ send_event()

bool esphome::api::APIConnection::send_event ( event::Event event,
std::string  event_type 
)

Definition at line 1324 of file api_connection.cpp.

◆ send_event_info()

bool esphome::api::APIConnection::send_event_info ( event::Event event)

Definition at line 1330 of file api_connection.cpp.

◆ send_fan_info()

bool esphome::api::APIConnection::send_fan_info ( fan::Fan fan)

Definition at line 317 of file api_connection.cpp.

◆ send_fan_state()

bool esphome::api::APIConnection::send_fan_state ( fan::Fan fan)

Definition at line 298 of file api_connection.cpp.

◆ send_homeassistant_service_call()

void esphome::api::APIConnection::send_homeassistant_service_call ( const HomeassistantServiceResponse call)
inline

Definition at line 120 of file api_connection.h.

◆ send_light_info()

bool esphome::api::APIConnection::send_light_info ( light::LightState light)

Definition at line 384 of file api_connection.cpp.

◆ send_light_state()

bool esphome::api::APIConnection::send_light_state ( light::LightState light)

Definition at line 359 of file api_connection.cpp.

◆ send_list_info_done()

bool esphome::api::APIConnection::send_list_info_done ( )
inline

Definition at line 24 of file api_connection.h.

◆ send_lock_info()

bool esphome::api::APIConnection::send_lock_info ( lock::Lock a_lock)

Definition at line 923 of file api_connection.cpp.

◆ send_lock_state()

bool esphome::api::APIConnection::send_lock_state ( lock::Lock a_lock,
lock::LockState  state 
)

Definition at line 914 of file api_connection.cpp.

◆ send_log_message()

bool esphome::api::APIConnection::send_log_message ( int  level,
const char *  tag,
const char *  line 
)

Definition at line 1405 of file api_connection.cpp.

◆ send_media_player_info()

bool esphome::api::APIConnection::send_media_player_info ( media_player::MediaPlayer media_player)

Definition at line 1015 of file api_connection.cpp.

◆ send_media_player_state()

bool esphome::api::APIConnection::send_media_player_state ( media_player::MediaPlayer media_player)

Definition at line 1000 of file api_connection.cpp.

◆ send_number_info()

bool esphome::api::APIConnection::send_number_info ( number::Number number)

Definition at line 671 of file api_connection.cpp.

◆ send_number_state()

bool esphome::api::APIConnection::send_number_state ( number::Number number,
float  state 
)

Definition at line 661 of file api_connection.cpp.

◆ send_select_info()

bool esphome::api::APIConnection::send_select_info ( select::Select select)

Definition at line 863 of file api_connection.cpp.

◆ send_select_state()

bool esphome::api::APIConnection::send_select_state ( select::Select select,
std::string  state 
)

Definition at line 853 of file api_connection.cpp.

◆ send_sensor_info()

bool esphome::api::APIConnection::send_sensor_info ( sensor::Sensor sensor)

Definition at line 467 of file api_connection.cpp.

◆ send_sensor_state()

bool esphome::api::APIConnection::send_sensor_state ( sensor::Sensor sensor,
float  state 
)

Definition at line 457 of file api_connection.cpp.

◆ send_switch_info()

bool esphome::api::APIConnection::send_switch_info ( switch_::Switch a_switch)

Definition at line 498 of file api_connection.cpp.

◆ send_switch_state()

bool esphome::api::APIConnection::send_switch_state ( switch_::Switch a_switch,
bool  state 
)

Definition at line 489 of file api_connection.cpp.

◆ send_text_info()

bool esphome::api::APIConnection::send_text_info ( text::Text text)

Definition at line 825 of file api_connection.cpp.

◆ send_text_sensor_info()

bool esphome::api::APIConnection::send_text_sensor_info ( text_sensor::TextSensor text_sensor)

Definition at line 536 of file api_connection.cpp.

◆ send_text_sensor_state()

bool esphome::api::APIConnection::send_text_sensor_state ( text_sensor::TextSensor text_sensor,
std::string  state 
)

Definition at line 526 of file api_connection.cpp.

◆ send_text_state()

bool esphome::api::APIConnection::send_text_state ( text::Text text,
std::string  state 
)

Definition at line 815 of file api_connection.cpp.

◆ send_time_info()

bool esphome::api::APIConnection::send_time_info ( datetime::TimeEntity time)

Definition at line 752 of file api_connection.cpp.

◆ send_time_request()

void esphome::api::APIConnection::send_time_request ( )
inline

Definition at line 142 of file api_connection.h.

◆ send_time_state()

bool esphome::api::APIConnection::send_time_state ( datetime::TimeEntity time)

Definition at line 740 of file api_connection.cpp.

◆ send_update_info()

bool esphome::api::APIConnection::send_update_info ( update::UpdateEntity update)

Definition at line 1370 of file api_connection.cpp.

◆ send_update_state()

bool esphome::api::APIConnection::send_update_state ( update::UpdateEntity update)

Definition at line 1348 of file api_connection.cpp.

◆ send_valve_info()

bool esphome::api::APIConnection::send_valve_info ( valve::Valve valve)

Definition at line 968 of file api_connection.cpp.

◆ send_valve_state()

bool esphome::api::APIConnection::send_valve_state ( valve::Valve valve)

Definition at line 958 of file api_connection.cpp.

◆ start()

void esphome::api::APIConnection::start ( )

Definition at line 42 of file api_connection.cpp.

◆ subscribe_bluetooth_connections_free()

BluetoothConnectionsFreeResponse esphome::api::APIConnection::subscribe_bluetooth_connections_free ( const SubscribeBluetoothConnectionsFreeRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1153 of file api_connection.cpp.

◆ subscribe_bluetooth_le_advertisements()

void esphome::api::APIConnection::subscribe_bluetooth_le_advertisements ( const SubscribeBluetoothLEAdvertisementsRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1109 of file api_connection.cpp.

◆ subscribe_home_assistant_states()

void esphome::api::APIConnection::subscribe_home_assistant_states ( const SubscribeHomeAssistantStatesRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1515 of file api_connection.cpp.

◆ subscribe_homeassistant_services()

void esphome::api::APIConnection::subscribe_homeassistant_services ( const SubscribeHomeassistantServicesRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 202 of file api_connection.h.

◆ subscribe_logs()

void esphome::api::APIConnection::subscribe_logs ( const SubscribeLogsRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 197 of file api_connection.h.

◆ subscribe_states()

void esphome::api::APIConnection::subscribe_states ( const SubscribeStatesRequest msg)
inlineoverridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 193 of file api_connection.h.

◆ subscribe_voice_assistant()

void esphome::api::APIConnection::subscribe_voice_assistant ( const SubscribeVoiceAssistantRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1163 of file api_connection.cpp.

◆ switch_command()

void esphome::api::APIConnection::switch_command ( const SwitchCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 512 of file api_connection.cpp.

◆ text_command()

void esphome::api::APIConnection::text_command ( const TextCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 841 of file api_connection.cpp.

◆ time_command()

void esphome::api::APIConnection::time_command ( const TimeCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 765 of file api_connection.cpp.

◆ unsubscribe_bluetooth_le_advertisements()

void esphome::api::APIConnection::unsubscribe_bluetooth_le_advertisements ( const UnsubscribeBluetoothLEAdvertisementsRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1112 of file api_connection.cpp.

◆ update_command()

void esphome::api::APIConnection::update_command ( const UpdateCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1383 of file api_connection.cpp.

◆ valve_command()

void esphome::api::APIConnection::valve_command ( const ValveCommandRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 985 of file api_connection.cpp.

◆ voice_assistant_get_configuration()

VoiceAssistantConfigurationResponse esphome::api::APIConnection::voice_assistant_get_configuration ( const VoiceAssistantConfigurationRequest msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1227 of file api_connection.cpp.

◆ voice_assistant_set_configuration()

void esphome::api::APIConnection::voice_assistant_set_configuration ( const VoiceAssistantSetConfiguration msg)
overridevirtual

Implements esphome::api::APIServerConnection.

Definition at line 1253 of file api_connection.cpp.

Field Documentation

◆ APIServer

friend esphome::api::APIConnection::APIServer
protected

Definition at line 229 of file api_connection.h.

◆ client_api_version_major_

uint32_t esphome::api::APIConnection::client_api_version_major_ {0}
protected

Definition at line 249 of file api_connection.h.

◆ client_api_version_minor_

uint32_t esphome::api::APIConnection::client_api_version_minor_ {0}
protected

Definition at line 250 of file api_connection.h.

◆ client_combined_info_

std::string esphome::api::APIConnection::client_combined_info_
protected

Definition at line 248 of file api_connection.h.

◆ client_info_

std::string esphome::api::APIConnection::client_info_
protected

Definition at line 246 of file api_connection.h.

◆ client_peername_

std::string esphome::api::APIConnection::client_peername_
protected

Definition at line 247 of file api_connection.h.

◆ helper_

std::unique_ptr<APIFrameHelper> esphome::api::APIConnection::helper_
protected

Definition at line 244 of file api_connection.h.

◆ image_reader_

esp32_camera::CameraImageReader esphome::api::APIConnection::image_reader_
protected

Definition at line 252 of file api_connection.h.

◆ initial_state_iterator_

InitialStateIterator esphome::api::APIConnection::initial_state_iterator_
protected

Definition at line 264 of file api_connection.h.

◆ last_traffic_

uint32_t esphome::api::APIConnection::last_traffic_
protected

Definition at line 257 of file api_connection.h.

◆ list_entities_iterator_

ListEntitiesIterator esphome::api::APIConnection::list_entities_iterator_
protected

Definition at line 265 of file api_connection.h.

◆ log_subscription_

int esphome::api::APIConnection::log_subscription_ {ESPHOME_LOG_LEVEL_NONE}
protected

Definition at line 256 of file api_connection.h.

◆ next_close_

bool esphome::api::APIConnection::next_close_ = false
protected

Definition at line 262 of file api_connection.h.

◆ next_ping_retry_

uint32_t esphome::api::APIConnection::next_ping_retry_ {0}
protected

Definition at line 258 of file api_connection.h.

◆ parent_

APIServer* esphome::api::APIConnection::parent_
protected

Definition at line 263 of file api_connection.h.

◆ ping_retries_

uint8_t esphome::api::APIConnection::ping_retries_ {0}
protected

Definition at line 259 of file api_connection.h.

◆ proto_write_buffer_

std::vector<uint8_t> esphome::api::APIConnection::proto_write_buffer_
protected

Definition at line 243 of file api_connection.h.

◆ remove_

bool esphome::api::APIConnection::remove_ {false}
protected

Definition at line 239 of file api_connection.h.

◆ sent_ping_

bool esphome::api::APIConnection::sent_ping_ {false}
protected

Definition at line 260 of file api_connection.h.

◆ service_call_subscription_

bool esphome::api::APIConnection::service_call_subscription_ {false}
protected

Definition at line 261 of file api_connection.h.

◆ state_subs_at_

int esphome::api::APIConnection::state_subs_at_ = -1
protected

Definition at line 266 of file api_connection.h.

◆ state_subscription_

bool esphome::api::APIConnection::state_subscription_ {false}
protected

Definition at line 255 of file api_connection.h.

◆ WAITING_FOR_HELLO

enum esphome::api::APIConnection::ConnectionState esphome::api::APIConnection::WAITING_FOR_HELLO
protected

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