1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-18 19:22:22 +01:00

Fix a bunch of components for IDF 5 compatibility and #6802 (#6805)

This commit is contained in:
Keith Burzinski
2024-05-29 00:05:19 -05:00
committed by GitHub
parent ec3164f800
commit bff24e2977
18 changed files with 55 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
#include "ct_clamp_sensor.h"
#include "esphome/core/log.h"
#include <cinttypes>
#include <cmath>
namespace esphome {
@@ -37,8 +38,8 @@ void CTClampSensor::update() {
float rms_ac = 0;
if (rms_ac_squared > 0)
rms_ac = std::sqrt(rms_ac_squared);
ESP_LOGD(TAG, "'%s' - Raw AC Value: %.3fA after %d different samples (%d SPS)", this->name_.c_str(), rms_ac,
this->num_samples_, 1000 * this->num_samples_ / this->sample_duration_);
ESP_LOGD(TAG, "'%s' - Raw AC Value: %.3fA after %" PRIu32 " different samples (%" PRIu32 " SPS)",
this->name_.c_str(), rms_ac, this->num_samples_, 1000 * this->num_samples_ / this->sample_duration_);
this->publish_state(rms_ac);
});