mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
split pronto codes if they are too long (#3812)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
parent
71dd04b09e
commit
fb9984e21f
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue