esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
sensor.hpp
Go to the documentation of this file.
1#pragma once
2
5
8
9#include <cstdint>
10#include <string>
11
12namespace esphome::api {
13
14namespace proto {
15class ListEntitiesSensorResponse;
16class SensorStateResponse;
17} // namespace proto
18
27
30 std::uint32_t key = 0;
31 float state = 0.0F;
33 bool missing_state = false;
34};
35
36SensorInfo parse_sensor_info(const proto::ListEntitiesSensorResponse& msg);
37SensorState parse_sensor_state(const proto::SensorStateResponse& msg);
38
39} // namespace esphome::api
Common entity metadata shared by every entity domain.
Typed mirrors of the ESPHome protobuf enums.
Definition bytes.hpp:10
SensorState parse_sensor_state(const proto::SensorStateResponse &msg)
SensorStateClass
Mirror of proto enum SensorStateClass.
Definition enums.hpp:75
SensorInfo parse_sensor_info(const proto::ListEntitiesSensorResponse &msg)
Fields present on every ListEntities*Response.
Definition entity.hpp:16
Static description of a sensor entity.
Definition sensor.hpp:20
std::int32_t accuracy_decimals
Definition sensor.hpp:22
SensorStateClass state_class
Definition sensor.hpp:25
std::string device_class
Definition sensor.hpp:24
bool force_update
Definition sensor.hpp:23
std::string unit_of_measurement
Definition sensor.hpp:21
A sensor's reported value.
Definition sensor.hpp:29
float state
Definition sensor.hpp:31
std::uint32_t key
Definition sensor.hpp:30
bool missing_state
True when the sensor currently has no valid value.
Definition sensor.hpp:33