esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
connection_options.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <chrono>
7#include <string>
8
9namespace esphome::api {
10
14 std::string client_info = "esphome-api-client";
15
17 std::string noise_psk;
18
21 std::string expected_name;
22
26 bool login = true;
27
30 std::string password;
31
33 std::chrono::milliseconds connect_timeout{30000};
34
36 std::chrono::milliseconds keepalive_interval{20000};
37
39 std::chrono::milliseconds keepalive_timeout{90000};
40};
41
42} // namespace esphome::api
Definition bytes.hpp:10
Knobs controlling a single Connection. Defaults mirror aioesphomeapi.
Definition connection_options.hpp:12
std::chrono::milliseconds connect_timeout
Overall deadline for TCP connect + handshake + HelloResponse.
Definition connection_options.hpp:33
bool login
Send a login (AuthenticationRequest) right after HelloRequest.
Definition connection_options.hpp:26
std::string client_info
Client identification reported to the device in HelloRequest.
Definition connection_options.hpp:14
std::string expected_name
Optional expected device name; if set and the device reports a different name the handshake fails (gu...
Definition connection_options.hpp:21
std::chrono::milliseconds keepalive_timeout
How long to wait for a PingResponse before declaring the link dead.
Definition connection_options.hpp:39
std::chrono::milliseconds keepalive_interval
How often to send a keepalive PingRequest once connected.
Definition connection_options.hpp:36
std::string noise_psk
Optional pre-shared Noise key (base64, 32 bytes). Empty ⇒ plaintext.
Definition connection_options.hpp:17
std::string password
Optional plaintext API password (deprecated ESPHome auth).
Definition connection_options.hpp:30