diff --git a/examples/basicLight.cpp b/examples/legacy/basicLight/basicLight.ino similarity index 100% rename from examples/basicLight.cpp rename to examples/legacy/basicLight/basicLight.ino diff --git a/examples/blindControl.cpp b/examples/legacy/blindControl/blindControl.ino similarity index 100% rename from examples/blindControl.cpp rename to examples/legacy/blindControl/blindControl.ino diff --git a/examples/lightWithBrightness.cpp b/examples/legacy/lightWithBrightness/lightWithBrightness.ino similarity index 100% rename from examples/lightWithBrightness.cpp rename to examples/legacy/lightWithBrightness/lightWithBrightness.ino diff --git a/examples/lightWithColorTemp.cpp b/examples/legacy/lightWithColorTemp/lightWithColorTemp.ino similarity index 100% rename from examples/lightWithColorTemp.cpp rename to examples/legacy/lightWithColorTemp/lightWithColorTemp.ino diff --git a/examples/tempSensor.cpp b/examples/legacy/tempSensor/tempSensor.ino similarity index 100% rename from examples/tempSensor.cpp rename to examples/legacy/tempSensor/tempSensor.ino diff --git a/library.json b/library.json index aecf65d..68451a2 100644 --- a/library.json +++ b/library.json @@ -30,7 +30,8 @@ ], "headers": "Alex2ESP.h", "examples": [ - "examples/*.cpp" + "examples/*/*.ino", + "examples/legacy/*/*.ino" ], "dependencies": [ { diff --git a/readme.md b/readme.md index 1aa26a9..b4f7e1d 100644 --- a/readme.md +++ b/readme.md @@ -54,7 +54,7 @@ Then include the library in your project: #include ``` -Complete sketches are in [`examples/`](examples/): `basicLight.cpp`, `lightWithBrightness.cpp`, `lightWithColorTemp.cpp`, `tempSensor.cpp` and `blindControl.cpp`. Every example joins Wi-Fi with `WiFi.begin(WIFI_SSID, WIFI_PASSWORD)`; fill in the SSID, the password and your Alex2MQTT credentials before flashing. +Complete sketches are in [`examples/legacy/`](examples/legacy/), one folder each: `basicLight`, `lightWithBrightness`, `lightWithColorTemp`, `tempSensor` and `blindControl`. Every example joins Wi-Fi with `WiFi.begin(WIFI_SSID, WIFI_PASSWORD)`; fill in the SSID, the password and your Alex2MQTT credentials before flashing. --- @@ -339,7 +339,7 @@ Behaviour changes: - `PlaybackController` and `WakeOnLANController` are announced with `"properties": {}`, as their pages show them. - Removed: `AlexaInterface::getJSON()` (`toJson()` adds the capability to the capabilities of its endpoint) and `getProps()` (the row has the properties), `ActionMapping::getJSON()` and the `String` and `std::vector` members of `ActionMapping`, the class `FriendlyName`. -Memory: `examples/basicLight.cpp` for a D1 mini takes 30,520 bytes of static RAM (1.1.0: 52,768) and 333,989 bytes of flash (1.1.0: 350,885), as PlatformIO reports them (espressif8266 4.2.1, Arduino core 3.1.2). 18,260 bytes of the static RAM were the five 2 KB queue slots, three more 2 KB buffers and the two HTTP clients; 3,720 were the names, versions and properties of all interfaces and the names of the display categories, which are in flash now. SNTP and the time stamp are 1.8 KB of the flash figure. The instance, names, configuration and mappings of a capability are 2.0 KB of it, the directive handler and the ErrorResponse 0.9 KB, the kinds of messages and the UUID 1.3 KB. A kind that a sketch does not send and a report helper that it does not call are not linked. With `-DALEX2ESP_LOG_MAX=0` the sketch takes 30,496 bytes of static RAM and 327,953 of flash, with `-DALEX2ESP_LOG_MAX=3` 30,520 and 334,477. +Memory: `examples/legacy/basicLight` for a D1 mini takes 30,520 bytes of static RAM (1.1.0: 52,768) and 333,989 bytes of flash (1.1.0: 350,885), as PlatformIO reports them (espressif8266 4.2.1, Arduino core 3.1.2). 18,260 bytes of the static RAM were the five 2 KB queue slots, three more 2 KB buffers and the two HTTP clients; 3,720 were the names, versions and properties of all interfaces and the names of the display categories, which are in flash now. SNTP and the time stamp are 1.8 KB of the flash figure. The instance, names, configuration and mappings of a capability are 2.0 KB of it, the directive handler and the ErrorResponse 0.9 KB, the kinds of messages and the UUID 1.3 KB. A kind that a sketch does not send and a report helper that it does not call are not linked. With `-DALEX2ESP_LOG_MAX=0` the sketch takes 30,496 bytes of static RAM and 327,953 of flash, with `-DALEX2ESP_LOG_MAX=3` 30,520 and 334,477. Tests: `pio test -e native` in the repository runs 135 host tests: 52 of the receive and publish logic (reassembly of fragments, the directives that wait for `loop()`, repeated directives, the size limits, a heap without room, the wait between reconnects, topics, time stamps, the message id), 35 of discovery (the discovery object of every example against what 1.1.0 announced, the 28 rows against the interface pages, a type without a row, the discovery objects of a range, a mode and a toggle controller, a scene and a doorbell, what a capability refuses and that it is left out afterwards, the states and the asset ids), 16 of dispatch (the device and the capability a directive reaches, one handler for two devices, the handlers of 1.x, one that answers later, a second handler for a name and one more than a device keeps, a capability more than a device holds, the answers to a directive for a capability the device lacks and to one without a handler, the log level above what the build has and the level that prints nothing) and 32 of the messages (every kind against the JSON and the topic it is published with, every report helper against the JSON of its property, values outside of their range, the names of 1.x, the scale of a temperature, what `send()` and `sendAsync()` refuse). No board is needed.