[bedjet_codec] Remove `assert()` (#7543)

This commit is contained in:
Keith Burzinski 2024-10-06 15:01:43 -05:00 committed by GitHub
parent 1c0ee5ae6b
commit 56e305f986
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,8 +13,10 @@ float bedjet_temp_to_f(const uint8_t temp) {
/** Cleans up the packet before sending. */
BedjetPacket *BedjetCodec::clean_packet_() {
// So far no commands require more than 2 bytes of data.
assert(this->packet_.data_length <= 2);
// So far no commands require more than 2 bytes of data
if (this->packet_.data_length > 2) {
ESP_LOGW(TAG, "Packet may be malformed");
}
for (int i = this->packet_.data_length; i < 2; i++) {
this->packet_.data[i] = '\0';
}