From 6976bf04591d4811398aed2bbd478be073b70e55 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 3 May 2021 19:51:20 +0200 Subject: [PATCH] Fix Hue on ESP32 --- tasmota/xdrv_20_hue.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasmota/xdrv_20_hue.ino b/tasmota/xdrv_20_hue.ino index 4b742bf65..9044d02b9 100644 --- a/tasmota/xdrv_20_hue.ino +++ b/tasmota/xdrv_20_hue.ino @@ -727,7 +727,12 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) { if (Webserver->args()) { response = "["; +#ifdef ESP82666 // ESP8266 memory is limited, avoid copying and modify in place JsonParser parser((char*) Webserver->arg((Webserver->args())-1).c_str()); +#else // does not work on ESP32, we need to get a fresh copy of the string + String request_arg = Webserver->arg((Webserver->args())-1); + JsonParser parser((char*) request_arg.c_str()); +#endif JsonParserObject root = parser.getRootObject(); JsonParserToken hue_on = root[PSTR("on")];