Skip to content

Commit

Permalink
split pronto codes if they are too long (esphome#3812)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Sieb <[email protected]>
  • Loading branch information
ssieb and Samuel Sieb authored Sep 15, 2022
1 parent 917bbc6 commit 7a91ca9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion esphome/components/remote_base/pronto_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,18 @@ optional<ProntoData> 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

0 comments on commit 7a91ca9

Please sign in to comment.