esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
select.hpp
Go to the documentation of this file.
1#pragma once
2
5
9
10#include <cstdint>
11#include <memory>
12#include <string>
13#include <vector>
14
15namespace esphome::api {
16
17namespace proto {
18class ListEntitiesSelectResponse;
19class SelectStateResponse;
20class SelectCommandRequest;
21} // namespace proto
22
25 std::vector<std::string> options;
26};
27
30 std::uint32_t key = 0;
31 std::string state;
33 bool missing_state = false;
34};
35
38 std::uint32_t key = 0;
39 std::string state;
40};
41
42SelectInfo parse_select_info(const proto::ListEntitiesSelectResponse& msg);
43SelectState parse_select_state(const proto::SelectStateResponse& msg);
44std::unique_ptr<ProtoMessage> to_message(const SelectCommand& cmd);
45
46} // namespace esphome::api
Common entity metadata shared by every entity domain.
Typed mirrors of the ESPHome protobuf enums.
Definition bytes.hpp:10
std::unique_ptr< ProtoMessage > to_message(const AlarmControlPanelCommand &cmd)
SelectState parse_select_state(const proto::SelectStateResponse &msg)
SelectInfo parse_select_info(const proto::ListEntitiesSelectResponse &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 select's value.
Definition select.hpp:37
std::string state
Definition select.hpp:39
std::uint32_t key
Definition select.hpp:38
Static description of a select entity.
Definition select.hpp:24
std::vector< std::string > options
Definition select.hpp:25
A select's reported value.
Definition select.hpp:29
bool missing_state
True when the select currently has no valid value.
Definition select.hpp:33
std::uint32_t key
Definition select.hpp:30
std::string state
Definition select.hpp:31