esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Attributes | List of all members
esphome::api::ConnectionOptions Struct Reference

Knobs controlling a single Connection. Defaults mirror aioesphomeapi. More...

#include <connection_options.hpp>

Collaboration diagram for esphome::api::ConnectionOptions:
Collaboration graph
[legend]

Public Attributes

std::string client_info = "esphome-api-client"
 Client identification reported to the device in HelloRequest.
 
std::string noise_psk
 Optional pre-shared Noise key (base64, 32 bytes). Empty ⇒ plaintext.
 
std::string expected_name
 Optional expected device name; if set and the device reports a different name the handshake fails (guards against connecting to the wrong host).
 
bool login = true
 Send a login (AuthenticationRequest) right after HelloRequest.
 
std::string password
 Optional plaintext API password (deprecated ESPHome auth).
 
std::chrono::milliseconds connect_timeout {30000}
 Overall deadline for TCP connect + handshake + HelloResponse.
 
std::chrono::milliseconds keepalive_interval {20000}
 How often to send a keepalive PingRequest once connected.
 
std::chrono::milliseconds keepalive_timeout {90000}
 How long to wait for a PingResponse before declaring the link dead.
 

Detailed Description

Knobs controlling a single Connection. Defaults mirror aioesphomeapi.

Member Data Documentation

◆ client_info

std::string esphome::api::ConnectionOptions::client_info = "esphome-api-client"

Client identification reported to the device in HelloRequest.

◆ connect_timeout

std::chrono::milliseconds esphome::api::ConnectionOptions::connect_timeout {30000}

Overall deadline for TCP connect + handshake + HelloResponse.

◆ expected_name

std::string esphome::api::ConnectionOptions::expected_name

Optional expected device name; if set and the device reports a different name the handshake fails (guards against connecting to the wrong host).

◆ keepalive_interval

std::chrono::milliseconds esphome::api::ConnectionOptions::keepalive_interval {20000}

How often to send a keepalive PingRequest once connected.

◆ keepalive_timeout

std::chrono::milliseconds esphome::api::ConnectionOptions::keepalive_timeout {90000}

How long to wait for a PingResponse before declaring the link dead.

◆ login

bool esphome::api::ConnectionOptions::login = true

Send a login (AuthenticationRequest) right after HelloRequest.

The device treats the connection as authenticated only after this; without it the device logs "requested access without authentication". Default on.

◆ noise_psk

std::string esphome::api::ConnectionOptions::noise_psk

Optional pre-shared Noise key (base64, 32 bytes). Empty ⇒ plaintext.

◆ password

std::string esphome::api::ConnectionOptions::password

Optional plaintext API password (deprecated ESPHome auth).

Sent in the AuthenticationRequest when login is true; empty means "no password".


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