esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
valve.hpp
Go to the documentation of this file.
1#pragma once
2
5
9
10#include <cstdint>
11#include <memory>
12#include <optional>
13#include <string>
14
15namespace esphome::api {
16
17namespace proto {
18class ListEntitiesValveResponse;
19class ValveStateResponse;
20class ValveCommandRequest;
21} // namespace proto
22
25 std::string device_class;
26 bool assumed_state = false;
27 bool supports_position = false;
28 bool supports_stop = false;
29};
30
32struct ValveState {
33 std::uint32_t key = 0;
34 float position = 0.0F;
36};
37
40 std::uint32_t key = 0;
41 std::optional<float> position;
42 bool stop = false;
43};
44
45ValveInfo parse_valve_info(const proto::ListEntitiesValveResponse& msg);
46ValveState parse_valve_state(const proto::ValveStateResponse& msg);
47std::unique_ptr<ProtoMessage> to_message(const ValveCommand& cmd);
48
49} // 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)
ValveState parse_valve_state(const proto::ValveStateResponse &msg)
ValveOperation
Mirror of proto enum ValveOperation.
Definition enums.hpp:370
ValveInfo parse_valve_info(const proto::ListEntitiesValveResponse &msg)
Lightweight base class for every generated ESPHome API message.
Fields present on every ListEntities*Response.
Definition entity.hpp:16
A command targeting a valve entity.
Definition valve.hpp:39
bool stop
Definition valve.hpp:42
std::optional< float > position
Definition valve.hpp:41
std::uint32_t key
Definition valve.hpp:40
Static description of a valve entity.
Definition valve.hpp:24
bool supports_stop
Definition valve.hpp:28
std::string device_class
Definition valve.hpp:25
bool assumed_state
Definition valve.hpp:26
bool supports_position
Definition valve.hpp:27
A valve's reported state.
Definition valve.hpp:32
std::uint32_t key
Definition valve.hpp:33
ValveOperation current_operation
Definition valve.hpp:35
float position
Definition valve.hpp:34