14static const char *
const TAG =
"debug";
17 ESP_LOGCONFIG(TAG,
"Debug component:");
22 LOG_SENSOR(
" ",
"Free space on heap", this->
free_sensor_);
23 LOG_SENSOR(
" ",
"Largest free heap block", this->
block_sensor_);
25#if defined(USE_ESP8266) && USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 5, 2)
30 char device_info_buffer[DEVICE_INFO_BUFFER_SIZE];
31 ESP_LOGD(TAG,
"ESPHome version %s", ESPHOME_VERSION);
32 size_t pos =
buf_append_str(device_info_buffer, DEVICE_INFO_BUFFER_SIZE, 0, ESPHOME_VERSION);
35 ESP_LOGD(TAG,
"Free Heap Size: %" PRIu32
" bytes", this->
free_heap_);
44 char reset_reason_buffer[RESET_REASON_BUFFER_SIZE];
46 get_reset_reason_(std::span<char, RESET_REASON_BUFFER_SIZE>(reset_reason_buffer)));
50#if defined(USE_ESP32) || defined(USE_ZEPHYR)
60 ESP_LOGD(TAG,
"Free Heap Size: %" PRIu32
" bytes", this->
free_heap_);
70 this->last_loop_timetag_ = now;
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void status_momentary_warning(const char *name, uint32_t length=5000)
Set warning status flag and automatically clear it after a timeout.
sensor::Sensor * loop_time_sensor_
float get_setup_priority() const override
uint32_t last_loop_timetag_
void log_partition_info_()
Logs information about the device's partition table.
size_t get_device_info_(std::span< char, DEVICE_INFO_BUFFER_SIZE > buffer, size_t pos)
sensor::Sensor * free_sensor_
sensor::Sensor * fragmentation_sensor_
void dump_config() override
uint32_t get_free_heap_()
sensor::Sensor * block_sensor_
const char * get_reset_reason_(std::span< char, RESET_REASON_BUFFER_SIZE > buffer)
text_sensor::TextSensor * reset_reason_
sensor::Sensor * cpu_frequency_sensor_
text_sensor::TextSensor * device_info_
void publish_state(float state)
Publish a new state to the front-end.
void publish_state(const std::string &state)
constexpr float LATE
For components that should be initialized at the very end of the setup process.
size_t buf_append_str(char *buf, size_t size, size_t pos, const char *str)
Safely append a string to buffer, returning new position (capped at size).
uint32_t arch_get_cpu_freq_hz()
Application App
Global storage of Application pointer - only one Application can exist.