split pronto codes if they are too long (#3812)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb 2022-09-15 12:27:50 -07:00 committed by Jesse Hills
parent 71dd04b09e
commit fb9984e21f
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -227,7 +227,18 @@ optional<ProntoData> ProntoProtocol::decode(RemoteReceiveData src) {
return out; 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 remote_base
} // namespace esphome } // namespace esphome