mirror of
https://github.com/esphome/esphome.git
synced 2024-12-26 23:41:45 +01:00
fix some CI Lint requests
This commit is contained in:
parent
75b49b3702
commit
fcffaa5857
2 changed files with 6 additions and 5 deletions
|
@ -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];
|
||||
|
|
|
@ -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<typename... Ts> class SendAction : public Action<Ts...>, 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue