1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Fix compile with latest esp-idf on esp32c6 (#5677)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
DAVe3283
2023-11-05 16:13:01 -07:00
committed by GitHub
parent 3ee85d7516
commit e0cee472c3
29 changed files with 132 additions and 88 deletions

View File

@@ -1,5 +1,6 @@
#include "cse7766.h"
#include "esphome/core/log.h"
#include <cinttypes>
namespace esphome {
namespace cse7766 {
@@ -162,7 +163,7 @@ void CSE7766Component::update() {
if (counts != 0) {
const auto avg = acc / counts;
ESP_LOGV(TAG, "Got %s_acc=%.2f %s_counts=%d %s=%.1f", name, acc, name, counts, name, avg);
ESP_LOGV(TAG, "Got %s_acc=%.2f %s_counts=%" PRIu32 " %s=%.1f", name, acc, name, counts, name, avg);
if (sensor != nullptr) {
sensor->publish_state(avg);
@@ -178,7 +179,8 @@ void CSE7766Component::update() {
publish_state("power", this->power_sensor_, this->power_acc_, this->power_counts_);
if (this->energy_total_counts_ != 0) {
ESP_LOGV(TAG, "Got energy_total=%.2f energy_total_counts=%d", this->energy_total_, this->energy_total_counts_);
ESP_LOGV(TAG, "Got energy_total=%.2f energy_total_counts=%" PRIu32, this->energy_total_,
this->energy_total_counts_);
if (this->energy_sensor_ != nullptr) {
this->energy_sensor_->publish_state(this->energy_total_);