mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[bedjet_codec] Remove `assert()` (#7543)
				
					
				
			This commit is contained in:
		| @@ -13,8 +13,10 @@ float bedjet_temp_to_f(const uint8_t temp) { | |||||||
|  |  | ||||||
| /** Cleans up the packet before sending. */ | /** Cleans up the packet before sending. */ | ||||||
| BedjetPacket *BedjetCodec::clean_packet_() { | BedjetPacket *BedjetCodec::clean_packet_() { | ||||||
|   // So far no commands require more than 2 bytes of data. |   // So far no commands require more than 2 bytes of data | ||||||
|   assert(this->packet_.data_length <= 2); |   if (this->packet_.data_length > 2) { | ||||||
|  |     ESP_LOGW(TAG, "Packet may be malformed"); | ||||||
|  |   } | ||||||
|   for (int i = this->packet_.data_length; i < 2; i++) { |   for (int i = this->packet_.data_length; i < 2; i++) { | ||||||
|     this->packet_.data[i] = '\0'; |     this->packet_.data[i] = '\0'; | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user