ESPHome  2022.9.1
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 ()=default
 
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_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_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)
 
bool send_bluetooth_le_advertisement (const BluetoothLEAdvertisementResponse &call)
 
void send_time_request ()
 
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
 
void subscribe_bluetooth_le_advertisements (const SubscribeBluetoothLEAdvertisementsRequest &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
 
- 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)
 

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_subscribe_bluetooth_le_advertisements_request (const SubscribeBluetoothLEAdvertisementsRequest &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_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_media_player_command_request (const MediaPlayerCommandRequest &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_
 
esp32_camera::CameraImageReader image_reader_
 
bool state_subscription_ {false}
 
int log_subscription_ {ESPHOME_LOG_LEVEL_NONE}
 
uint32_t last_traffic_
 
bool sent_ping_ {false}
 
bool service_call_subscription_ {false}
 
bool bluetooth_le_advertisement_subscription_ {true}
 
bool next_close_ = false
 
APIServerparent_
 
InitialStateIterator initial_state_iterator_
 
ListEntitiesIterator list_entities_iterator_
 
int state_subs_at_ = -1
 

Detailed Description

Definition at line 17 of file api_connection.h.

Member Enumeration Documentation

◆ ConnectionState

Enumerator
WAITING_FOR_HELLO 
CONNECTED 
AUTHENTICATED 

Definition at line 170 of file api_connection.h.

Constructor & Destructor Documentation

◆ APIConnection()

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

Definition at line 22 of file api_connection.cpp.

◆ ~APIConnection()

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

Member Function Documentation

◆ button_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 684 of file api_connection.cpp.

◆ camera_image()

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

Implements esphome::api::APIServerConnection.

Definition at line 803 of file api_connection.cpp.

◆ climate_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 564 of file api_connection.cpp.

◆ connect()

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

Implements esphome::api::APIServerConnection.

Definition at line 854 of file api_connection.cpp.

◆ cover_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 223 of file api_connection.cpp.

◆ create_buffer()

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

Implements esphome::api::ProtoService.

Definition at line 158 of file api_connection.h.

◆ device_info()

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

Implements esphome::api::APIServerConnection.

Definition at line 872 of file api_connection.cpp.

◆ disconnect()

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

Implements esphome::api::APIServerConnection.

Definition at line 152 of file api_connection.cpp.

◆ execute_service()

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

Implements esphome::api::APIServerConnection.

Definition at line 902 of file api_connection.cpp.

◆ fan_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 286 of file api_connection.cpp.

◆ get_time()

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

Implements esphome::api::APIServerConnection.

Definition at line 143 of file api_connection.h.

◆ hello()

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

Implements esphome::api::APIServerConnection.

Definition at line 840 of file api_connection.cpp.

◆ is_authenticated()

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

Implements esphome::api::ProtoService.

Definition at line 151 of file api_connection.h.

◆ is_connection_setup()

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

Implements esphome::api::ProtoService.

Definition at line 152 of file api_connection.h.

◆ light_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 366 of file api_connection.cpp.

◆ list_entities()

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

Implements esphome::api::APIServerConnection.

Definition at line 129 of file api_connection.h.

◆ lock_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 717 of file api_connection.cpp.

◆ loop()

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

Definition at line 47 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 763 of file api_connection.cpp.

◆ number_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 623 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 161 of file api_connection.cpp.

◆ on_fatal_error()

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

Implements esphome::api::ProtoService.

Definition at line 960 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 820 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 895 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 956 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 116 of file api_connection.h.

◆ on_unauthenticated_access()

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

Implements esphome::api::ProtoService.

Definition at line 952 of file api_connection.cpp.

◆ ping()

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

Implements esphome::api::APIServerConnection.

Definition at line 127 of file api_connection.h.

◆ select_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 660 of file api_connection.cpp.

◆ send_()

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

◆ send_binary_sensor_info()

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

Definition at line 176 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 166 of file api_connection.cpp.

◆ send_bluetooth_le_advertisement()

bool esphome::api::APIConnection::send_bluetooth_le_advertisement ( const BluetoothLEAdvertisementResponse call)
inline

Definition at line 102 of file api_connection.h.

◆ send_buffer()

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

Implements esphome::api::ProtoService.

Definition at line 916 of file api_connection.cpp.

◆ send_button_info()

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

Definition at line 672 of file api_connection.cpp.

◆ send_camera_info()

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

Definition at line 792 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 783 of file api_connection.cpp.

◆ send_climate_info()

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

Definition at line 528 of file api_connection.cpp.

◆ send_climate_state()

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

Definition at line 497 of file api_connection.cpp.

◆ send_cover_info()

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

Definition at line 207 of file api_connection.cpp.

◆ send_cover_state()

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

Definition at line 192 of file api_connection.cpp.

◆ send_fan_info()

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

Definition at line 270 of file api_connection.cpp.

◆ send_fan_state()

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

Definition at line 253 of file api_connection.cpp.

◆ send_homeassistant_service_call()

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

Definition at line 96 of file api_connection.h.

◆ send_light_info()

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

Definition at line 332 of file api_connection.cpp.

◆ send_light_state()

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

Definition at line 307 of file api_connection.cpp.

◆ send_list_info_done()

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

Definition at line 25 of file api_connection.h.

◆ send_lock_info()

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

Definition at line 703 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 694 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 826 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 748 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 737 of file api_connection.cpp.

◆ send_number_info()

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

Definition at line 605 of file api_connection.cpp.

◆ send_number_state()

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

Definition at line 595 of file api_connection.cpp.

◆ send_select_info()

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

Definition at line 645 of file api_connection.cpp.

◆ send_select_state()

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

Definition at line 635 of file api_connection.cpp.

◆ send_sensor_info()

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

Definition at line 414 of file api_connection.cpp.

◆ send_sensor_state()

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

Definition at line 404 of file api_connection.cpp.

◆ send_switch_info()

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

Definition at line 444 of file api_connection.cpp.

◆ send_switch_state()

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

Definition at line 435 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 481 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 471 of file api_connection.cpp.

◆ send_time_request()

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

Definition at line 109 of file api_connection.h.

◆ start()

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

Definition at line 34 of file api_connection.cpp.

◆ subscribe_bluetooth_le_advertisements()

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

Implements esphome::api::APIServerConnection.

Definition at line 148 of file api_connection.h.

◆ subscribe_home_assistant_states()

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

Implements esphome::api::APIServerConnection.

Definition at line 913 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 139 of file api_connection.h.

◆ subscribe_logs()

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

Implements esphome::api::APIServerConnection.

Definition at line 134 of file api_connection.h.

◆ subscribe_states()

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

Implements esphome::api::APIServerConnection.

Definition at line 130 of file api_connection.h.

◆ switch_command()

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

Implements esphome::api::APIServerConnection.

Definition at line 457 of file api_connection.cpp.

Field Documentation

◆ APIServer

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

Definition at line 166 of file api_connection.h.

◆ bluetooth_le_advertisement_subscription_

bool esphome::api::APIConnection::bluetooth_le_advertisement_subscription_ {true}
protected

Definition at line 193 of file api_connection.h.

◆ client_info_

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

Definition at line 183 of file api_connection.h.

◆ helper_

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

Definition at line 181 of file api_connection.h.

◆ image_reader_

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

Definition at line 185 of file api_connection.h.

◆ initial_state_iterator_

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

Definition at line 196 of file api_connection.h.

◆ last_traffic_

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

Definition at line 190 of file api_connection.h.

◆ list_entities_iterator_

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

Definition at line 197 of file api_connection.h.

◆ log_subscription_

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

Definition at line 189 of file api_connection.h.

◆ next_close_

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

Definition at line 194 of file api_connection.h.

◆ parent_

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

Definition at line 195 of file api_connection.h.

◆ proto_write_buffer_

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

Definition at line 180 of file api_connection.h.

◆ remove_

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

Definition at line 176 of file api_connection.h.

◆ sent_ping_

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

Definition at line 191 of file api_connection.h.

◆ service_call_subscription_

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

Definition at line 192 of file api_connection.h.

◆ state_subs_at_

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

Definition at line 198 of file api_connection.h.

◆ state_subscription_

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

Definition at line 188 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: