diff --git a/keywords.txt b/keywords.txt index d483099..a3206b9 100644 --- a/keywords.txt +++ b/keywords.txt @@ -92,5 +92,6 @@ ALEX2ESP_MAX_MESSAGE LITERAL1 ALEX2ESP_MAX_QUEUED_DIRECTIVES LITERAL1 ALEX2ESP_MAX_QUEUED_BYTES LITERAL1 ALEX2ESP_LOG_MAX LITERAL1 +ALEX2ESP_VERSION LITERAL1 ALEXA_TIMESTAMP_SIZE LITERAL1 MAX_EVENTS LITERAL1 diff --git a/library.json b/library.json index 89d9379..aecf65d 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Alex2ESP", - "version": "1.1.0", + "version": "1.2.0", "description": "Companion library for the Alex2MQTT Alexa skill: exposes ESP8266 devices to Alexa through alex2mqtt.stormysdream.club over MQTT (discovery, directives, state reports).", "keywords": [ "alexa", diff --git a/library.properties b/library.properties index cb702c7..3fafd52 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Alex2ESP -version=1.1.0 +version=1.2.0 author=David maintainer=David sentence=A companion library for the Alex2MQTT Alexa Skill (ESP8266). diff --git a/readme.md b/readme.md index 548f407..3343f44 100644 --- a/readme.md +++ b/readme.md @@ -260,6 +260,8 @@ Memory: `examples/basicLight.cpp` for a D1 mini takes 34,452 bytes of static RAM Tests: `pio test -e native` in the repository runs 41 host tests of the receive and publish logic (reassembly of fragments, the directives that wait for `loop()`, repeated directives, the size limits, a heap without room, topics, time stamps). No board is needed. +Packaging: `library.json`, `library.properties` and the `softwareVersion` and `firmwareVersion` that a device reports in discovery say 1.2.0; the library has the number in one place, `ALEX2ESP_VERSION` in `src/AlexaVersion.h`. The `platformio.ini` of the repository is for the host tests; a sketch does not need it. + Boards that run 1.1.0 are not affected: the backend keeps the token topic and the HTTP routes. ### 1.1.0 diff --git a/src/AlexaDevice.cpp b/src/AlexaDevice.cpp index 95d6ca7..3d7ddbc 100644 --- a/src/AlexaDevice.cpp +++ b/src/AlexaDevice.cpp @@ -110,7 +110,7 @@ JsonDocument AlexaDevice::getDeviceJSON() const { additionalAttributes["manufacturer"] = manufacturer; additionalAttributes["model"] = model; additionalAttributes["serialNumber"] = "ESP2Alex"; - additionalAttributes["firmwareVersion"] = "1.1.0"; + additionalAttributes["firmwareVersion"] = ALEX2ESP_VERSION; additionalAttributes["softwareVersion"] = softwareVersion; additionalAttributes["customIdentifier"] = "ESP2Alex"; diff --git a/src/AlexaDevice.h b/src/AlexaDevice.h index 4f87793..357363c 100644 --- a/src/AlexaDevice.h +++ b/src/AlexaDevice.h @@ -11,6 +11,7 @@ #include #include "AlexaStatusMessage.h" #include "AlexaTransport.h" +#include "AlexaVersion.h" #define MAX_EVENTS 10 @@ -205,7 +206,7 @@ private: String manufacturerName = "Alexa2MQTT"; String manufacturer = "Alexa2MQTT"; String model = "Alexa2MQTT"; - const String softwareVersion = "1.1.0"; + const String softwareVersion = ALEX2ESP_VERSION; std::deque capabilities; // deque: pointers handed out by addCapability stay valid diff --git a/src/AlexaVersion.h b/src/AlexaVersion.h new file mode 100644 index 0000000..0788600 --- /dev/null +++ b/src/AlexaVersion.h @@ -0,0 +1,8 @@ +// The version of the library, the same as in library.json and library.properties. The devices report it to Alexa +// as softwareVersion and firmwareVersion. +#ifndef ALEXA_VERSION_H +#define ALEXA_VERSION_H + +#define ALEX2ESP_VERSION "1.2.0" + +#endif // ALEXA_VERSION_H