From 7e42afba383fde8a03153fcf9103e652ae2cbea9 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Mon, 11 May 2020 00:01:11 +0200 Subject: [PATCH] (2.4.7) Fix ESP32 --- library.properties | 2 +- src/Espalexa.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library.properties b/library.properties index 5747432..19b8dc3 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Espalexa -version=2.4.6 +version=2.4.7 author=Christian Schwinne maintainer=Christian Schwinne sentence=Library to control an ESP module with the Alexa voice assistant diff --git a/src/Espalexa.h b/src/Espalexa.h index 6632adf..0b89d38 100644 --- a/src/Espalexa.h +++ b/src/Espalexa.h @@ -10,7 +10,7 @@ */ /* * @title Espalexa library - * @version 2.4.6 + * @version 2.4.7 * @author Christian Schwinne * @license MIT * @contributors d-999 @@ -49,7 +49,7 @@ #include #ifdef ESPALEXA_DEBUG - #pragma message "Espalexa 2.4.6 debug mode" + #pragma message "Espalexa 2.4.7 debug mode" #define EA_DEBUG(x) Serial.print (x) #define EA_DEBUGLN(x) Serial.println (x) #else @@ -157,7 +157,7 @@ class Espalexa { sprintf_P(buf, PSTR("{\"state\":{\"on\":%s,\"bri\":%u%s%s,\"alert\":\"none%s\",\"mode\":\"homeautomation\",\"reachable\":true}," "\"type\":\"%s\",\"name\":\"%s\",\"modelid\":\"%s\",\"manufacturername\":\"Philips\",\"productname\":\"E%u" - "\",\"uniqueid\":\"%u\",\"swversion\":\"espalexa-2.4.6\"}") + "\",\"uniqueid\":\"%u\",\"swversion\":\"espalexa-2.4.7\"}") , (dev->getValue())?"true":"false", dev->getLastValue()-1, buf_col, buf_ct, buf_cm, typeString(dev->getType()), dev->getName().c_str(), modelidString(dev->getType()), static_cast(dev->getType()), encodeLightId(deviceId+1)); @@ -182,7 +182,7 @@ class Espalexa { } res += "\r\nFree Heap: " + (String)ESP.getFreeHeap(); res += "\r\nUptime: " + (String)millis(); - res += "\r\n\r\nEspalexa library v2.4.6 by Christian Schwinne 2020"; + res += "\r\n\r\nEspalexa library v2.4.7 by Christian Schwinne 2020"; server->send(200, "text/plain", res); } #endif @@ -299,7 +299,7 @@ class Espalexa { espalexaUdp.beginPacket(espalexaUdp.remoteIP(), espalexaUdp.remotePort()); #ifdef ARDUINO_ARCH_ESP32 - espalexaUdp.write((uint8_t*)buf, response.length()); + espalexaUdp.write((uint8_t*)buf, strlen(buf)); #else espalexaUdp.write(buf); #endif