esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
text.hpp
Go to the documentation of this file.
1#pragma once
2
5
9
10#include <cstdint>
11#include <memory>
12#include <string>
13
14namespace esphome::api {
15
16namespace proto {
17class ListEntitiesTextResponse;
18class TextStateResponse;
19class TextCommandRequest;
20} // namespace proto
21
24 std::uint32_t min_length = 0;
25 std::uint32_t max_length = 0;
26 std::string pattern;
28};
29
31struct TextState {
32 std::uint32_t key = 0;
33 std::string state;
35 bool missing_state = false;
36};
37
40 std::uint32_t key = 0;
41 std::string state;
42};
43
44TextInfo parse_text_info(const proto::ListEntitiesTextResponse& msg);
45TextState parse_text_state(const proto::TextStateResponse& msg);
46std::unique_ptr<ProtoMessage> to_message(const TextCommand& cmd);
47
48} // namespace esphome::api
Common entity metadata shared by every entity domain.
Typed mirrors of the ESPHome protobuf enums.
Definition bytes.hpp:10
TextMode
Mirror of proto enum TextMode.
Definition enums.hpp:364
TextInfo parse_text_info(const proto::ListEntitiesTextResponse &msg)
std::unique_ptr< ProtoMessage > to_message(const AlarmControlPanelCommand &cmd)
TextState parse_text_state(const proto::TextStateResponse &msg)
Lightweight base class for every generated ESPHome API message.
Fields present on every ListEntities*Response.
Definition entity.hpp:16
A command to set a text entity's value.
Definition text.hpp:39
std::string state
Definition text.hpp:41
std::uint32_t key
Definition text.hpp:40
Static description of a text entity.
Definition text.hpp:23
TextMode mode
Definition text.hpp:27
std::uint32_t min_length
Definition text.hpp:24
std::uint32_t max_length
Definition text.hpp:25
std::string pattern
Definition text.hpp:26
A text entity's reported value.
Definition text.hpp:31
std::string state
Definition text.hpp:33
std::uint32_t key
Definition text.hpp:32
bool missing_state
True when the text entity currently has no valid value.
Definition text.hpp:35