From 5dec9d88f6e02b6f7d82ac3b531251111d3a5b72 Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Mon, 22 Aug 2022 18:26:36 -0700 Subject: [PATCH] add log messages for bad pronto codes (#3738) Co-authored-by: Samuel Sieb --- esphome/components/remote_base/pronto_protocol.cpp | 1 + .../remote_transmitter/remote_transmitter_esp32.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/esphome/components/remote_base/pronto_protocol.cpp b/esphome/components/remote_base/pronto_protocol.cpp index a2b1a16e07..d434744e49 100644 --- a/esphome/components/remote_base/pronto_protocol.cpp +++ b/esphome/components/remote_base/pronto_protocol.cpp @@ -106,6 +106,7 @@ void ProntoProtocol::send_pronto_(RemoteTransmitData *dst, const std::vectorrmt_temp_.push_back(rmt_item); } + if ((this->rmt_temp_.data() == nullptr) || this->rmt_temp_.empty()) { + ESP_LOGE(TAG, "Empty data"); + return; + } for (uint32_t i = 0; i < send_times; i++) { esp_err_t error = rmt_write_items(this->channel_, this->rmt_temp_.data(), this->rmt_temp_.size(), true); if (error != ESP_OK) {