From fcffaa5857f835d82045a5388c2574951ad5d200 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Sun, 6 Oct 2024 02:26:32 +0200 Subject: [PATCH] fix some CI Lint requests --- esphome/components/espnow/espnow.cpp | 4 ++-- esphome/components/espnow/espnow.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/esphome/components/espnow/espnow.cpp b/esphome/components/espnow/espnow.cpp index 5acf27d112..937ea94b84 100644 --- a/esphome/components/espnow/espnow.cpp +++ b/esphome/components/espnow/espnow.cpp @@ -172,14 +172,14 @@ esp_err_t ESPNowComponent::del_peer(uint64_t addr) { ESPNowDefaultProtocol *ESPNowComponent::get_default_protocol() { if (this->protocols_[ESPNOW_MAIN_PROTOCOL_ID] == nullptr) { - this->register_protocol(new ESPNowDefaultProtocol()); + this->register_protocol(new ESPNowDefaultProtocol()); // NOLINT } return (ESPNowDefaultProtocol *) this->protocols_[ESPNOW_MAIN_PROTOCOL_ID]; } ESPNowProtocol *ESPNowComponent::get_protocol_component_(uint32_t protocol) { if (this->protocols_[protocol] == nullptr) { - ESP_LOGE(TAG, "Protocol for '%06lx' is not registered", protocol); + ESP_LOGE(TAG, "Protocol for '%06" PRIx32 "' is not registered", protocol); return nullptr; } return this->protocols_[protocol]; diff --git a/esphome/components/espnow/espnow.h b/esphome/components/espnow/espnow.h index d7c402cc54..ffcfe2f9e2 100644 --- a/esphome/components/espnow/espnow.h +++ b/esphome/components/espnow/espnow.h @@ -113,7 +113,7 @@ struct ESPNowPacket { } protected: - static uint32_t protocol_(uint8_t *protocol) { + static uint32_t protocol_(const uint8_t *protocol) { return (*(protocol + 2) << 0) + (*(protocol + 1) << 8) + (*(protocol + 0) << 16); } }; @@ -276,10 +276,11 @@ template class SendAction : public Action, public Parente } if (this->static_) { - this->parent_->get_default_protocol()->send(mac, this->data_static_.data(), this->data_static_.size()); + this->parent_->get_default_protocol()->send(mac, this->data_static_.data(), this->data_static_.size(), command); } else { ByteBuffer data = this->data_func_(x...); - this->parent_->get_default_protocol()->send(mac, data.get_data().data(), (uint8_t) data.get_used_space()); + this->parent_->get_default_protocol()->send(mac, data.get_data().data(), (uint8_t) data.get_used_space(), + command); } }