mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-07 16:57:05 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user