1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 14:55:50 +00:00

Debug component: add free PSRAM sensor (#5334)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
kahrendt
2023-09-04 22:02:59 -04:00
committed by GitHub
parent d382ca2401
commit 562f7c8718
6 changed files with 78 additions and 9 deletions

View File

@@ -33,6 +33,9 @@ class DebugComponent : public PollingComponent {
void set_fragmentation_sensor(sensor::Sensor *fragmentation_sensor) { fragmentation_sensor_ = fragmentation_sensor; }
#endif
void set_loop_time_sensor(sensor::Sensor *loop_time_sensor) { loop_time_sensor_ = loop_time_sensor; }
#ifdef USE_ESP32
void set_psram_sensor(sensor::Sensor *psram_sensor) { this->psram_sensor_ = psram_sensor; }
#endif // USE_ESP32
#endif // USE_SENSOR
protected:
uint32_t free_heap_{};
@@ -47,6 +50,9 @@ class DebugComponent : public PollingComponent {
sensor::Sensor *fragmentation_sensor_{nullptr};
#endif
sensor::Sensor *loop_time_sensor_{nullptr};
#ifdef USE_ESP32
sensor::Sensor *psram_sensor_{nullptr};
#endif // USE_ESP32
#endif // USE_SENSOR
#ifdef USE_TEXT_SENSOR