ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
ds3231_temperature.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
3
4namespace esphome::ds3231 {
5
6ESPHOME_LOG_TAG(TAG, "ds3231.sensor");
7
9 float temperature;
10 if (!this->status_comm_result(this->parent_->read_temperature(temperature)))
11 return;
12 this->publish_state(temperature);
13}
14
16 LOG_SENSOR("", "DS3231 Temperature", this);
17 LOG_UPDATE_INTERVAL(this);
18}
19
20} // namespace esphome::ds3231
bool status_comm_result(bool ok)
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:65
ESPHOME_LOG_TAG(TAG, "ds3231")
uint16_t temperature
Definition sun_gtil2.cpp:12