ESPHome 2026.11.0-dev
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->parent_->read_temperature(temperature)) {
11 this->status_set_warning();
12 return;
13 }
15 this->publish_state(temperature);
16}
17
19 LOG_SENSOR("", "DS3231 Temperature", this);
20 LOG_UPDATE_INTERVAL(this);
21}
22
23} // namespace esphome::ds3231
void status_clear_warning()
Definition component.h:291
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