IDF 5 fixes for various components from test4.yaml (#5622)

This commit is contained in:
Keith Burzinski 2023-10-29 00:49:19 -05:00 committed by GitHub
parent d4cb29a380
commit f7f63c9da1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View file

@ -194,8 +194,8 @@ esp_err_t CameraWebServer::streaming_handler_(struct httpd_req *req) {
int64_t frame_time = millis() - last_frame; int64_t frame_time = millis() - last_frame;
last_frame = millis(); last_frame = millis();
ESP_LOGD(TAG, "MJPG: %uB %ums (%.1ffps)", (uint32_t) image->get_data_length(), (uint32_t) frame_time, ESP_LOGD(TAG, "MJPG: %" PRIu32 "B %" PRIu32 "ms (%.1ffps)", (uint32_t) image->get_data_length(),
1000.0 / (uint32_t) frame_time); (uint32_t) frame_time, 1000.0 / (uint32_t) frame_time);
} }
} }
@ -205,7 +205,7 @@ esp_err_t CameraWebServer::streaming_handler_(struct httpd_req *req) {
esp32_camera::global_esp32_camera->stop_stream(esphome::esp32_camera::WEB_REQUESTER); esp32_camera::global_esp32_camera->stop_stream(esphome::esp32_camera::WEB_REQUESTER);
ESP_LOGI(TAG, "STREAM: closed. Frames: %u", frames); ESP_LOGI(TAG, "STREAM: closed. Frames: %" PRIu32, frames);
return res; return res;
} }

View file

@ -2,6 +2,7 @@
#ifdef USE_ESP32 #ifdef USE_ESP32
#include <cinttypes>
#include <freertos/FreeRTOS.h> #include <freertos/FreeRTOS.h>
#include <freertos/semphr.h> #include <freertos/semphr.h>

View file

@ -61,7 +61,7 @@ void Tuya::dump_config() {
} else if (info.type == TuyaDatapointType::ENUM) { } else if (info.type == TuyaDatapointType::ENUM) {
ESP_LOGCONFIG(TAG, " Datapoint %u: enum (value: %d)", info.id, info.value_enum); ESP_LOGCONFIG(TAG, " Datapoint %u: enum (value: %d)", info.id, info.value_enum);
} else if (info.type == TuyaDatapointType::BITMASK) { } else if (info.type == TuyaDatapointType::BITMASK) {
ESP_LOGCONFIG(TAG, " Datapoint %u: bitmask (value: %x)", info.id, info.value_bitmask); ESP_LOGCONFIG(TAG, " Datapoint %u: bitmask (value: %" PRIx32 ")", info.id, info.value_bitmask);
} else { } else {
ESP_LOGCONFIG(TAG, " Datapoint %u: unknown", info.id); ESP_LOGCONFIG(TAG, " Datapoint %u: unknown", info.id);
} }
@ -342,7 +342,7 @@ void Tuya::handle_datapoints_(const uint8_t *buffer, size_t len) {
ESP_LOGW(TAG, "Datapoint %u has bad bitmask len %zu", datapoint.id, data_size); ESP_LOGW(TAG, "Datapoint %u has bad bitmask len %zu", datapoint.id, data_size);
return; return;
} }
ESP_LOGD(TAG, "Datapoint %u update to %#08X", datapoint.id, datapoint.value_bitmask); ESP_LOGD(TAG, "Datapoint %u update to %#08" PRIX32, datapoint.id, datapoint.value_bitmask);
break; break;
default: default:
ESP_LOGW(TAG, "Datapoint %u has unknown type %#02hhX", datapoint.id, static_cast<uint8_t>(datapoint.type)); ESP_LOGW(TAG, "Datapoint %u has unknown type %#02hhX", datapoint.id, static_cast<uint8_t>(datapoint.type));
@ -594,7 +594,7 @@ optional<TuyaDatapoint> Tuya::get_datapoint_(uint8_t datapoint_id) {
void Tuya::set_numeric_datapoint_value_(uint8_t datapoint_id, TuyaDatapointType datapoint_type, const uint32_t value, void Tuya::set_numeric_datapoint_value_(uint8_t datapoint_id, TuyaDatapointType datapoint_type, const uint32_t value,
uint8_t length, bool forced) { uint8_t length, bool forced) {
ESP_LOGD(TAG, "Setting datapoint %u to %u", datapoint_id, value); ESP_LOGD(TAG, "Setting datapoint %u to %" PRIu32, datapoint_id, value);
optional<TuyaDatapoint> datapoint = this->get_datapoint_(datapoint_id); optional<TuyaDatapoint> datapoint = this->get_datapoint_(datapoint_id);
if (!datapoint.has_value()) { if (!datapoint.has_value()) {
ESP_LOGW(TAG, "Setting unknown datapoint %u", datapoint_id); ESP_LOGW(TAG, "Setting unknown datapoint %u", datapoint_id);

View file

@ -1,5 +1,8 @@
#pragma once #pragma once
#include <cinttypes>
#include <vector>
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/defines.h" #include "esphome/core/defines.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
@ -10,8 +13,6 @@
#include "esphome/core/time.h" #include "esphome/core/time.h"
#endif #endif
#include <vector>
namespace esphome { namespace esphome {
namespace tuya { namespace tuya {