Merge pull request #4153 from ascillato/patch-1

Fix Alexa for Core 2.5.0 (also backwards compatible)
This commit is contained in:
Theo Arends 2018-10-25 08:55:48 +02:00 committed by GitHub
commit 9c054f107e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -660,11 +660,11 @@ void HueLights(String *path)
if ((device < 1) || (device > maxhue)) {
device = 1;
}
if (1 == WebServer->args()) {
if (WebServer->args()) {
response = "[";
StaticJsonBuffer<400> jsonBuffer;
JsonObject &hue_json = jsonBuffer.parseObject(WebServer->arg(0));
JsonObject &hue_json = jsonBuffer.parseObject(WebServer->arg((WebServer->args())-1));
if (hue_json.containsKey("on")) {
response += FPSTR(HUE_LIGHT_RESPONSE_JSON);