mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 02:36:35 +00:00
Fix Hue on ESP32
This commit is contained in:
parent
5db9b6f2c9
commit
6976bf0459
@ -727,7 +727,12 @@ void HueLightsCommand(uint8_t device, uint32_t device_id, String &response) {
|
|||||||
if (Webserver->args()) {
|
if (Webserver->args()) {
|
||||||
response = "[";
|
response = "[";
|
||||||
|
|
||||||
|
#ifdef ESP82666 // ESP8266 memory is limited, avoid copying and modify in place
|
||||||
JsonParser parser((char*) Webserver->arg((Webserver->args())-1).c_str());
|
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();
|
JsonParserObject root = parser.getRootObject();
|
||||||
|
|
||||||
JsonParserToken hue_on = root[PSTR("on")];
|
JsonParserToken hue_on = root[PSTR("on")];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user