esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
date.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 ListEntitiesDateResponse;
17class DateStateResponse;
18class DateCommandRequest;
19} // namespace proto
20
22struct DateInfo : EntityInfo {};
23
25struct DateState {
26 std::uint32_t key = 0;
28 bool missing_state = false;
29 std::uint32_t year = 0;
30 std::uint32_t month = 0;
31 std::uint32_t day = 0;
32};
33
36 std::uint32_t key = 0;
37 std::uint32_t year = 0;
38 std::uint32_t month = 0;
39 std::uint32_t day = 0;
40};
41
42DateInfo parse_date_info(const proto::ListEntitiesDateResponse& msg);
43DateState parse_date_state(const proto::DateStateResponse& msg);
44std::unique_ptr<ProtoMessage> to_message(const DateCommand& 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)
DateState parse_date_state(const proto::DateStateResponse &msg)
DateInfo parse_date_info(const proto::ListEntitiesDateResponse &msg)
Lightweight base class for every generated ESPHome API message.
A command to set a date's value.
Definition date.hpp:35
std::uint32_t month
Definition date.hpp:38
std::uint32_t year
Definition date.hpp:37
std::uint32_t day
Definition date.hpp:39
std::uint32_t key
Definition date.hpp:36
Static description of a date entity.
Definition date.hpp:22
A date's reported value.
Definition date.hpp:25
std::uint32_t month
Definition date.hpp:30
std::uint32_t year
Definition date.hpp:29
std::uint32_t day
Definition date.hpp:31
bool missing_state
True when the date currently has no valid value.
Definition date.hpp:28
std::uint32_t key
Definition date.hpp:26
Fields present on every ListEntities*Response.
Definition entity.hpp:16