esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
time.hpp
Go to the documentation of this file.
1#pragma once
2
5
9
10#include <cstdint>
11#include <memory>
12
13namespace esphome::api {
14
15namespace proto {
16class ListEntitiesTimeResponse;
17class TimeStateResponse;
18class TimeCommandRequest;
19} // namespace proto
20
22struct TimeInfo : EntityInfo {};
23
25struct TimeState {
26 std::uint32_t key = 0;
28 bool missing_state = false;
29 std::uint32_t hour = 0;
30 std::uint32_t minute = 0;
31 std::uint32_t second = 0;
32};
33
36 std::uint32_t key = 0;
37 std::uint32_t hour = 0;
38 std::uint32_t minute = 0;
39 std::uint32_t second = 0;
40};
41
42TimeInfo parse_time_info(const proto::ListEntitiesTimeResponse& msg);
43TimeState parse_time_state(const proto::TimeStateResponse& msg);
44std::unique_ptr<ProtoMessage> to_message(const TimeCommand& 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)
TimeState parse_time_state(const proto::TimeStateResponse &msg)
TimeInfo parse_time_info(const proto::ListEntitiesTimeResponse &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 time's value.
Definition time.hpp:35
std::uint32_t hour
Definition time.hpp:37
std::uint32_t second
Definition time.hpp:39
std::uint32_t minute
Definition time.hpp:38
std::uint32_t key
Definition time.hpp:36
Static description of a time entity.
Definition time.hpp:22
A time's reported value.
Definition time.hpp:25
bool missing_state
True when the time currently has no valid value.
Definition time.hpp:28
std::uint32_t second
Definition time.hpp:31
std::uint32_t key
Definition time.hpp:26
std::uint32_t minute
Definition time.hpp:30
std::uint32_t hour
Definition time.hpp:29