- Adds HTTP API
- Adds the option to set duration in custom apps
- Adds sound item to onscreen menu
- Adds wifi reconnect
- Adds [hidden features](https://blueforcer.github.io/awtrix-light/#/dev) wich allows you for example to change the bootsound
- Shows IP address on boot
- Fixes a bug where deleting a custom app with empty payload doesnt work
- Fixes a bug where autotransition doesnt start at its own

closes #32
This commit is contained in:
Stephan Mühl
2023-04-01 21:49:00 +02:00
committed by GitHub
33 changed files with 2282 additions and 648 deletions

View File

@@ -14,7 +14,9 @@
- [Timer](timer.md)
- [Icons](icons.md)
- [Sounds](sounds.md)
- [Hidden features](dev.md)
- MQTT
- API
- [MQTT/HTTP](api.md)
- [Custom Pages & Notifications](custom.md)
- [Commands](mqtt.md)

View File

@@ -1,26 +1,40 @@
# MQTT Commands
# MQTT / HTTP API
## Status
In MQTT awtrix send its stats every 10s to `[PREFIX]/stats`
With HTTP, make GET request to `http://[IP]/api/stats`
## Add custom app
create custom apps or notifications to display your own text and icons.
Have a look at [this section](custom?id=custom-apps-and-notifications)
| Topic | URL | Payload/Body | HTTP Header | HTTP method |
| --- | --- | --- |--- |--- |
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/custom` | JSON | name = [appname] | POST |
## Dismiss Notification
Dismiss a notification which was set to "hold"=true.
| Topic | Payload |
| --- | --- |
| `[PREFIX]/notify/dismiss` | empty payload |
| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/notify/dismiss` | empty payload/body | POST |
## Switch Apps
Switch to next or previous app.
| Topic | Payload |
| --- | --- |
| `[PREFIX]/nextapp` | empty payload |
| `[PREFIX]/previousapp` | empty payload |
| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/nextapp` | `http://[IP]/api/nextapp` | empty payload/body | POST |
| `[PREFIX]/previousapp` | `http://[IP]/api/previousapp` | payload/body | POST |
## Switch to Specific App
Switch to a specific app by name.
| Topic | Payload |
| --- | --- |
| `[PREFIX]/switch` | `{"name":"time"}` |
| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/switch` | `http://[IP]/api/switch` | `{"name":"time"}` | POST |
Built-in app names are:
- `time`
@@ -34,9 +48,9 @@ For custom apps, use the name you set in the topic. For example, if `[PREFIX]/cu
## Add/remove and rearange apps
| Topic |
| --- |
| `[PREFIX]/apps` |
| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/apps`|`http://[IP]/api/apps`| json | POST |
!> This function provides users with the ability to manage the apps on their device by adding, removing, and rearranging them. However, as it is an experimental feature, caution should be exercised, particularly when attempting to rearrange multiple apps at once, as this can lead to unintended consequences due to the resulting shifts in position of other apps.
@@ -98,15 +112,21 @@ In this example,
- The "bat" app is inactive and will be removed,
- and the "github" app is active and should be displayed in position 4.
## Add timer
create custom apps or notifications to display your own text and icons.
have a look at [this section](custom)
| Topic | URL | Payload/Body |HTTP method |
| --- | --- | --- |--- |
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/notify/dismiss` | empty payload/body | POST |
## Change Settings
Change various settings related to the app display.
| Topic | Payload |
| --- | --- |
| `[PREFIX]/settings` | JSON properties |
| Topic | URL | Payload/Body |HTTP method |
| --- | --- | --- |--- |
| `[PREFIX]/settings` |`http://[IP]/api/settings`| JSON | POST |
Each property is optional; you do not need to send all.

View File

@@ -1,7 +1,9 @@
# Custom Apps & Notifications
# Custom Apps and Notifications
With AWTRIX Light, you can create custom apps or notifications to display your own text and icons.
Simply send a JSON object to the topic "awtrixlight/custom/[page]" where [page] is a the name of your page (without spaces).
With AWTRIX Light, you can create custom apps or notifications to display your own text and icons.
With MQTT simply send a JSON object to the topic `[PREFIX]/custom/[page]` where [page] is a the name of your page (without spaces).
With the [HTTP API](api?id=add-custom-app) you have to set the appname in the request header (`name = Appname`)
## JSON Properties
@@ -9,7 +11,7 @@ The JSON object has the following properties:
| Key | Type | Description | Default |
| --- | ---- | ----------- | ------- |
| `pos` | number | defines the position of your custompage in the loop, starting at 0 for the first position. This will only apply with your first push. You cant change the position afterwards with [this function](mqtt?id=addremove-and-rearange-apps) |
| `pos` | number | defines the position of your custompage in the loop, starting at 0 for the first position. This will only apply with your first push. You cant change the position afterwards with [this function](api?id=addremove-and-rearange-apps) |
| `text` | string | The text to display on the page. | |
| `icon` | string | The icon ID or filename (without extension) to display on the page. | |
| `repeat` | number | Sets how many times the text should be scrolled through the matrix before the display ends. | 1 |
@@ -41,5 +43,6 @@ Here's an example JSON object to display the text "Hello, AWTRIX Light!" with th
}
```
## Delete a custom page
To delelte a custom page simply send a empty payload to the same topic
## Delete a custom app
To delete a custom app simply send a empty payload/body to the same topic/url.
You can also use [this API](api?id=addremove-and-rearange-apps)

15
docs/dev.md Normal file
View File

@@ -0,0 +1,15 @@
# Hidden Features
Ok, now they are no longer hidden :).
This section contains small setting options that the majority of users do not change or change very rarely and therefore saved the effort of creating an elaborate settings interface.
Create a `dev.json` in your filemanager.
## JSON Properties
The JSON object has the following properties:
| Key | Type | Description | Default |
| --- | ---- | ----------- | ------- |
| `bootsound` | string | Uses a custom melodie from the MELODIES folder | standart |
| `uppercase` | boolean | Print every character in uppercase | true |

View File

@@ -18,5 +18,6 @@ Hold down the middle button for 2s to exit the current menu and to save your set
| `WEEKDAY` | Allows selection of start of week. |
| `TEMP` | Allows selection of temperature system (°C or °F). |
| `APPS` | Allows to enable or disable internal apps |
| `SOUND` | Allows to enable or disable sound output |
| `UPDATE` | Check and download new firmware if available. |

View File

@@ -2,7 +2,7 @@
# Quick start
1. :computer: Connect your device to your PC or Mac and [use the online flahser](flasher.md)
2. :signal_strength: After flashing, Awtrix will open an access point with the name "AWTRIX LIGHT". Connect with PW "12345678".
3. :mag: Open a browser and navigate to 192.168.4.1. Enter your WiFi information and reboot the clock.
4. :clock1: Your clock is accessible via http://awtrixlight.local/.
3. :mag: Open a browser and navigate to 192.168.4.1. Enter your WiFi information and connect to your WiFi.
4. :clock1: Your clock is accessible via the IP adress you see at connect.
5. :gear: Set up your MQTT and other options in the web interface.
6. :heavy_check_mark: You're ready to go.