From 9c37e20a4b1028503474a8f9737fb83d81e47e0e Mon Sep 17 00:00:00 2001 From: ElVit <54866762+ElVit@users.noreply.github.com> Date: Tue, 25 Nov 2025 22:53:36 +0100 Subject: [PATCH] Update comments for byte validation checks --- components/panasonic_heatpump/panasonic_heatpump.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/panasonic_heatpump/panasonic_heatpump.cpp b/components/panasonic_heatpump/panasonic_heatpump.cpp index 347f9bb..7390e58 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.cpp +++ b/components/panasonic_heatpump/panasonic_heatpump.cpp @@ -148,7 +148,7 @@ namespace esphome { this->payload_length_ = byte_; } - // Discard message if format is wrong + // 3. byte shall be 0x01 or 0x10 if (this->response_message_.size() == 3 && byte_ != 0x01 && byte_ != 0x10) { this->response_receiving_ = false; @@ -157,6 +157,7 @@ namespace esphome delay(10); // NOLINT continue; } + // 4. byte shall be 0x10 or 0x21 if (this->response_message_.size() == 4 && byte_ != 0x10 && byte_ != 0x21) { this->response_receiving_ = false; @@ -232,7 +233,7 @@ namespace esphome { this->payload_length_ = byte_; } - // Discard message if format is wrong + // 3. byte shall be 0x01 or 0x10 if (this->request_message_.size() == 3 && byte_ != 0x01 && byte_ != 0x10) { this->request_receiving_ = false; @@ -241,6 +242,7 @@ namespace esphome delay(10); // NOLINT continue; } + // 4. byte shall be 0x10 or 0x21 if (this->request_message_.size() == 4 && byte_ != 0x10 && byte_ != 0x21) { this->request_receiving_ = false;