mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +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
917bbc669c
commit
7a91ca9809
@ -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 New Issue
Block a user