mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 09:08:41 +00:00
[esp32, debug] Add `cpu_frequency` config option and debug sensor (#8542)
This commit is contained in:
@@ -25,6 +25,7 @@ void DebugComponent::dump_config() {
|
||||
#ifdef USE_SENSOR
|
||||
LOG_SENSOR(" ", "Free space on heap", this->free_sensor_);
|
||||
LOG_SENSOR(" ", "Largest free heap block", this->block_sensor_);
|
||||
LOG_SENSOR(" ", "CPU frequency", this->cpu_frequency_sensor_);
|
||||
#if defined(USE_ESP8266) && USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 5, 2)
|
||||
LOG_SENSOR(" ", "Heap fragmentation", this->fragmentation_sensor_);
|
||||
#endif // defined(USE_ESP8266) && USE_ARDUINO_VERSION_CODE >= VERSION_CODE(2, 5, 2)
|
||||
@@ -86,6 +87,9 @@ void DebugComponent::update() {
|
||||
this->loop_time_sensor_->publish_state(this->max_loop_time_);
|
||||
this->max_loop_time_ = 0;
|
||||
}
|
||||
if (this->cpu_frequency_sensor_ != nullptr) {
|
||||
this->cpu_frequency_sensor_->publish_state(arch_get_cpu_freq_hz());
|
||||
}
|
||||
|
||||
#endif // USE_SENSOR
|
||||
update_platform_();
|
||||
|
||||
Reference in New Issue
Block a user