From 0097a55eaae62e2cd60ba92b968c137f5abefd0d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 8 Jul 2025 09:34:16 -0600 Subject: [PATCH] fixes --- esphome/components/runtime_stats/runtime_stats.cpp | 4 +++- esphome/components/runtime_stats/runtime_stats.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/esphome/components/runtime_stats/runtime_stats.cpp b/esphome/components/runtime_stats/runtime_stats.cpp index 75c59e77ba..96a222da84 100644 --- a/esphome/components/runtime_stats/runtime_stats.cpp +++ b/esphome/components/runtime_stats/runtime_stats.cpp @@ -1,5 +1,4 @@ #include "runtime_stats.h" -#include "esphome/core/defines.h" #ifdef USE_RUNTIME_STATS @@ -10,6 +9,9 @@ namespace esphome { namespace runtime_stats { +// Forward declaration to help compiler +class RuntimeStatsCollector; + RuntimeStatsCollector::RuntimeStatsCollector() : log_interval_(60000), next_log_time_(0) { global_runtime_stats = this; } diff --git a/esphome/components/runtime_stats/runtime_stats.h b/esphome/components/runtime_stats/runtime_stats.h index 24dae46b2e..de241e439c 100644 --- a/esphome/components/runtime_stats/runtime_stats.h +++ b/esphome/components/runtime_stats/runtime_stats.h @@ -1,5 +1,7 @@ #pragma once +#include "esphome/core/defines.h" + #ifdef USE_RUNTIME_STATS #include @@ -122,4 +124,4 @@ extern runtime_stats::RuntimeStatsCollector } // namespace esphome -#endif // USE_RUNTIME_STATS \ No newline at end of file +#endif // USE_RUNTIME_STATS