esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
client_options.hpp
Go to the documentation of this file.
1#pragma once
2
5
8
9#include <cstdint>
10#include <string>
11#include <utility>
12
13namespace esphome::api {
14
18 std::string host;
19
21 std::uint16_t port = static_cast<std::uint16_t>(default_port);
22
25
30
31 ClientOptions() = default;
32 ClientOptions(std::string h, const std::uint16_t p = static_cast<std::uint16_t>(default_port))
33 : host(std::move(h)), port(p) {}
34};
35
36} // namespace esphome::api
Compile-time configuration flags for esphome-api-client.
Tunables for a Connection's handshake and keepalive behaviour.
Definition bytes.hpp:10
constexpr unsigned default_port
Default TCP port of the ESPHome native API.
Definition config.hpp:18
Everything needed to reach and authenticate with one ESPHome device.
Definition client_options.hpp:16
std::string host
Device hostname or IP.
Definition client_options.hpp:18
std::uint16_t port
TCP port (default 6053).
Definition client_options.hpp:21
ConnectionOptions connection
Handshake / keepalive tunables (client_info, Noise PSK, timeouts, ...).
Definition client_options.hpp:24
bool subscribe_on_connect
When true (default), SyncClient::connect() automatically enumerates the device's entities and subscri...
Definition client_options.hpp:29
ClientOptions(std::string h, const std::uint16_t p=static_cast< std::uint16_t >(default_port))
Definition client_options.hpp:32
Knobs controlling a single Connection. Defaults mirror aioesphomeapi.
Definition connection_options.hpp:12