Avoid too many warnings if checksum of response message is invalid
This commit is contained in:
parent
1e1ebbf711
commit
e242962c05
|
|
@ -43,6 +43,10 @@ void PanasonicHeatpumpComponent::loop() {
|
|||
this->current_response_ = this->check_response(this->response_message_);
|
||||
switch (this->current_response_) {
|
||||
case ResponseType::UNKNOWN:
|
||||
this->response_message_.clear();
|
||||
this->loop_state_ = LoopState::SEND_REQUEST;
|
||||
break;
|
||||
case ResponseType::RECEIVING:
|
||||
this->loop_state_ = LoopState::SEND_REQUEST;
|
||||
break;
|
||||
case ResponseType::STANDARD:
|
||||
|
|
@ -285,7 +289,7 @@ ResponseType PanasonicHeatpumpComponent::check_response(const std::vector<uint8_
|
|||
if (data[0] != 0x71)
|
||||
return ResponseType::UNKNOWN;
|
||||
if (this->response_receiving_)
|
||||
return ResponseType::UNKNOWN;
|
||||
return ResponseType::RECEIVING;
|
||||
if (data.size() != RESPONSE_MSG_SIZE) {
|
||||
ESP_LOGW(TAG, "Invalid response message length: recieved %d - expected %d", data.size(), RESPONSE_MSG_SIZE);
|
||||
delay(10); // NOLINT
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ enum RequestType : uint8_t {
|
|||
|
||||
enum ResponseType : uint8_t {
|
||||
UNKNOWN,
|
||||
RECEIVING,
|
||||
STANDARD,
|
||||
EXTRA,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue