Feature/nine additional alexa devices for presets (#2787)

* add 9 further alexa devices for calling presets 1-9

* use preset names from WLED for Alexa preset device names instead of hardcoded names

* update readme and version

* call alexaInit() at end of savePreset() to keep Alexa in sync with the preset IDs and names

* This reverts commit f8db06c7c5.

* change order to configured Alexa WLED name first, preset names afterwards

* fix status of devices when shown within Alexa, i.e. switching one preset on switches others off (except for alexaInvocationName)

* re-add getPresetName() after merge with master

* restore original readme for pull request

* restore original platformio.ini for pull request

* Logic simplification

* Pass string by reference

* Added number of presets check

* fix alexaInit() in case of alexaNumPresets==0

Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
This commit is contained in:
siggel
2022-10-25 23:42:26 +02:00
committed by GitHub
parent e1d7d9511f
commit 82af52a0bc
10 changed files with 288 additions and 222 deletions

View File

@@ -113,7 +113,7 @@
#ifndef WLED_DISABLE_ALEXA
#define ESPALEXA_ASYNC
#define ESPALEXA_NO_SUBPAGE
#define ESPALEXA_MAXDEVICES 1
#define ESPALEXA_MAXDEVICES 10
// #define ESPALEXA_DEBUG
#include "src/dependencies/espalexa/Espalexa.h"
#endif
@@ -358,6 +358,7 @@ WLED_GLOBAL uint8_t udpNumRetries _INIT(0); // Number of t
WLED_GLOBAL bool alexaEnabled _INIT(false); // enable device discovery by Amazon Echo
WLED_GLOBAL char alexaInvocationName[33] _INIT("Light"); // speech control name of device. Choose something voice-to-text can understand
WLED_GLOBAL byte alexaNumPresets _INIT(0); // number of presets to expose to Alexa, starting from preset 1, up to 9
#ifndef WLED_DISABLE_BLYNK
WLED_GLOBAL char blynkApiKey[36] _INIT(""); // Auth token for Blynk server. If empty, no connection will be made