ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
internal_temperature.h
Go to the documentation of this file.
1#pragma once
2
5
6// Every ESP32 variant except the original one exposes the on-chip sensor through
7// the IDF temperature_sensor driver (the original uses the legacy temprature_sens_read).
8#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32)
9#include "driver/temperature_sensor.h"
10#endif
11
13
15 public:
16#if defined(USE_ESP32) || (defined(USE_ZEPHYR) && defined(USE_NRF52))
17 void setup() override;
18#endif // USE_ESP32 || (USE_ZEPHYR && USE_NRF52)
19 void dump_config() override;
20
21 void update() override;
22
23#if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32)
24 protected:
25 temperature_sensor_handle_t tsens_{nullptr};
26#endif
27};
28
29} // namespace esphome::internal_temperature
This class simplifies creating components that periodically check a state.
Definition component.h:585
Base-class for all sensors.
Definition sensor.h:47