alexa: fix device discovery / state callback (#2388)

alexa device discovery/state calls use URL of type
/api/hash_id_key_whatever/lights

This is blocked when API is disabled and fails
also when http API is enabled because no apikey is
sent by amazon calls

Don't try to use the http api for alexa calls.
Responses for alexa are done by fauxmoesp lib,
so there's no need for the http api call.
This commit is contained in:
aL1aL7
2020-10-28 20:40:56 +01:00
committed by GitHub
parent 85969e4945
commit f6582ecd18

View File

@@ -224,6 +224,12 @@ bool _apiRequestCallback(AsyncWebServerRequest* request) {
}
if (!url.startsWith("/api/")) return false;
// [alexa] don't call the http api -> response for alexa is done by fauxmoesp lib
#if ALEXA_SUPPORT
if (url.indexOf("/lights") > 14 ) return false;
#endif
if (!apiAuthenticate(request)) return false;
return _apiDispatchRequest(url, request);