mirror of
https://github.com/geoffdavis/esphome-mitsubishiheatpump
synced 2024-08-30 18:12:13 +00:00
Merge branch 'develop' into unformat-select
This commit is contained in:
commit
562c7e7337
@ -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());
|
||||
}
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user