mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-01-02 19:47:29 +01:00
have fun
This commit is contained in:
17
custom_components/heapmon/heapmon.cpp
Normal file
17
custom_components/heapmon/heapmon.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user