1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

fix rc switch protocol 6 (#2672)

This commit is contained in:
Guillermo Ruffino
2021-11-10 00:15:15 -03:00
committed by GitHub
parent 97eaf3d4a1
commit 6e5cfac927

View File

@@ -101,10 +101,13 @@ bool RCSwitchBase::expect_sync(RemoteReceiveData &src) const {
if (!src.peek_space(this->sync_low_, 1))
return false;
} else {
if (!src.peek_space(this->sync_high_))
return false;
if (!src.peek_mark(this->sync_low_, 1))
// We cant peek a space at the beginning because signals starts with a low to high transition.
// this long space at the beginning is the separation between the transmissions itself, so it is actually
// added at the end kind of artificially (by the value given to "idle:" option by the user in the yaml)
if (!src.peek_mark(this->sync_low_))
return false;
src.advance(1);
return true;
}
src.advance(2);
return true;