Skip to content

Commit

Permalink
rc_switch: Fix Sync signal sent after the code. (esphome#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
M95D authored and micronen committed Feb 5, 2021
1 parent 30a9701 commit 1c18c5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esphome/components/remote_base/rc_switch_protocol.cpp
Expand Up @@ -55,13 +55,13 @@ void RCSwitchBase::sync(RemoteTransmitData *dst) const {
}
void RCSwitchBase::transmit(RemoteTransmitData *dst, uint64_t code, uint8_t len) const {
dst->set_carrier_frequency(0);
this->sync(dst);
for (int16_t i = len - 1; i >= 0; i--) {
if (code & ((uint64_t) 1 << i))
this->one(dst);
else
this->zero(dst);
}
this->sync(dst);
}

bool RCSwitchBase::expect_one(RemoteReceiveData &src) const {
Expand Down

0 comments on commit 1c18c5b

Please sign in to comment.