Merge branch 'develop' into unformat-select

This commit is contained in:
nathanjw 2023-12-30 19:31:41 -05:00 committed by GitHub
commit 562c7e7337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -700,6 +700,8 @@ void MitsubishiHeatPump::setup() {
this->hpStatusChanged(currentStatus);
}
);
hp->setPacketCallback(this->log_packet);
#endif
ESP_LOGCONFIG(
@ -768,3 +770,16 @@ void MitsubishiHeatPump::dump_state() {
LOG_CLIMATE("", "MitsubishiHeatPump Climate", this);
ESP_LOGI(TAG, "HELLO");
}
void MitsubishiHeatPump::log_packet(byte* packet, unsigned int length, char* packetDirection) {
String packetHex;
char textBuf[15];
for (int i = 0; i < length; i++) {
memset(textBuf, 0, 15);
sprintf(textBuf, "%02X ", packet[i]);
packetHex += textBuf;
}
ESP_LOGV(TAG, "PKT: [%s] %s", packetDirection, packetHex.c_str());
}

View File

@ -167,6 +167,8 @@ class MitsubishiHeatPump : public esphome::PollingComponent, public esphome::cli
void on_horizontal_swing_change(const std::string &swing);
void on_vertical_swing_change(const std::string &swing);
static void log_packet(byte* packet, unsigned int length, char* packetDirection);
private:
void enforce_remote_temperature_sensor_timeout();