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)) if (!src.peek_space(this->sync_low_, 1))
return false; return false;
} else { } else {
if (!src.peek_space(this->sync_high_)) // We cant peek a space at the beginning because signals starts with a low to high transition.
return false; // this long space at the beginning is the separation between the transmissions itself, so it is actually
if (!src.peek_mark(this->sync_low_, 1)) // 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; return false;
src.advance(1);
return true;
} }
src.advance(2); src.advance(2);
return true; return true;