mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	rc_switch: Fix Sync signal sent after the code. (#1426)
This commit is contained in:
		| @@ -55,13 +55,13 @@ void RCSwitchBase::sync(RemoteTransmitData *dst) const { | |||||||
| } | } | ||||||
| void RCSwitchBase::transmit(RemoteTransmitData *dst, uint64_t code, uint8_t len) const { | void RCSwitchBase::transmit(RemoteTransmitData *dst, uint64_t code, uint8_t len) const { | ||||||
|   dst->set_carrier_frequency(0); |   dst->set_carrier_frequency(0); | ||||||
|  |   this->sync(dst); | ||||||
|   for (int16_t i = len - 1; i >= 0; i--) { |   for (int16_t i = len - 1; i >= 0; i--) { | ||||||
|     if (code & ((uint64_t) 1 << i)) |     if (code & ((uint64_t) 1 << i)) | ||||||
|       this->one(dst); |       this->one(dst); | ||||||
|     else |     else | ||||||
|       this->zero(dst); |       this->zero(dst); | ||||||
|   } |   } | ||||||
|   this->sync(dst); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| bool RCSwitchBase::expect_one(RemoteReceiveData &src) const { | bool RCSwitchBase::expect_one(RemoteReceiveData &src) const { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user