From 7a91ca98090a57c180a01750c388f496a47aee93 Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Thu, 15 Sep 2022 12:27:50 -0700 Subject: [PATCH] split pronto codes if they are too long (#3812) Co-authored-by: Samuel Sieb --- esphome/components/remote_base/pronto_protocol.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/esphome/components/remote_base/pronto_protocol.cpp b/esphome/components/remote_base/pronto_protocol.cpp index d434744e49..d8798d4ab9 100644 --- a/esphome/components/remote_base/pronto_protocol.cpp +++ b/esphome/components/remote_base/pronto_protocol.cpp @@ -227,7 +227,18 @@ optional ProntoProtocol::decode(RemoteReceiveData src) { return out; } -void ProntoProtocol::dump(const ProntoData &data) { ESP_LOGD(TAG, "Received Pronto: data=%s", data.data.c_str()); } +void ProntoProtocol::dump(const ProntoData &data) { + std::string first, rest; + if (data.data.size() < 230) { + first = data.data; + } else { + first = data.data.substr(0, 229); + rest = data.data.substr(230); + } + ESP_LOGD(TAG, "Received Pronto: data=%s", first.c_str()); + if (!rest.empty()) + ESP_LOGD(TAG, "%s", rest.c_str()); +} } // namespace remote_base } // namespace esphome