From fb08a8d32222a9f399aa3011a7b077ab61ac6c42 Mon Sep 17 00:00:00 2001 From: GrKoR Date: Wed, 6 Apr 2022 16:01:57 +0300 Subject: [PATCH 1/2] local data excluded --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1679ca7..66c9f45 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ **/kitchen_ac/ /examples/*/*.h **/tests/test_* -**/__pycache__ \ No newline at end of file +**/__pycache__ +**/private/ \ No newline at end of file From 48198ff6ec91bcddeaf40903c499d3acfd9adc0a Mon Sep 17 00:00:00 2001 From: GrKoR Date: Wed, 6 Apr 2022 16:50:18 +0300 Subject: [PATCH 2/2] the size of the textBuf buffer Fixes #23 --- components/aux_ac/aux_ac.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/aux_ac/aux_ac.h b/components/aux_ac/aux_ac.h index a0a96fd..2e3d815 100644 --- a/components/aux_ac/aux_ac.h +++ b/components/aux_ac/aux_ac.h @@ -1143,10 +1143,10 @@ class AirCon : public esphome::Component, public esphome::climate::Climate { notAPacket = notAPacket || (packet->data[0] != AC_PACKET_START_BYTE); String st = ""; - char textBuf[10]; + char textBuf[11]; // заполняем время получения пакета - memset(textBuf, 0, 10); + memset(textBuf, 0, 11); sprintf(textBuf, "%010u", packet->msec); st = st + textBuf + ": "; @@ -1166,7 +1166,7 @@ class AirCon : public esphome::Component, public esphome::climate::Climate { // для нормальных пакетов надо заключить CRC в [] if ((!notAPacket) && (i == packet->header->body_length+AC_HEADER_SIZE)) st += "["; - memset(textBuf, 0, 10); + memset(textBuf, 0, 11); sprintf(textBuf, "%02X", packet->data[i]); st += textBuf;