Files
esphome-configs/custom_components/heapmon/heapmon.cpp
2024-05-23 21:24:52 +02:00

18 lines
339 B
C++

#include "heapmon.h"
#include "esphome/core/log.h"
namespace esphome {
namespace debug {
static const char *TAG = "heapmon";
void HeapMonitor::update() {
uint32_t free_heap = ESP.getFreeHeap();
ESP_LOGD(TAG, "Free Heap Size: %u bytes", free_heap);
this->publish_state(free_heap);
}
} // namespace debug
} // namespace esphome