v0.45
- Introduces an function that allows users to add, remove, and rearrange multiple apps on the device at once via MQTT. This provides greater flexibility and customization options. Please note that this function is experimental and should be used with caution. https://blueforcer.github.io/awtrix-light/#/mqtt?id=addremove-and-rearange-apps
This commit is contained in:
@@ -10,11 +10,11 @@
|
||||
|
||||
- Features
|
||||
- [Apps](apps.md)
|
||||
- [Custom Pages & Notifications](custom.md)
|
||||
- [Alarm clock](alarm.md)
|
||||
- [Timer](timer.md)
|
||||
- [Icons](icons.md)
|
||||
- [Sounds](sounds.md)
|
||||
|
||||
- MQTT
|
||||
- [Custom Pages & Notifications](custom.md)
|
||||
- [Commands](mqtt.md)
|
||||
|
||||
@@ -9,7 +9,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 1 for the first position. This will only apply with your first push. You cant change the position afterwards. For that you need to delete it and add it again. | At the end of the loop |
|
||||
| `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) |
|
||||
| `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 |
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
||||
<script src="https://unpkg.com/docsify-copy-code@2"></script>
|
||||
<script src="//unpkg.com/docsify-share/build/index.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1.22/components/prism-json.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-json.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
70
docs/mqtt.md
70
docs/mqtt.md
@@ -31,6 +31,76 @@ Built-in app names are:
|
||||
|
||||
For custom apps, use the name you set in the topic. For example, if `[PREFIX]/custom/test` is your topic, then `test` is the name.
|
||||
|
||||
## Add/remove and rearange apps
|
||||
|
||||
|
||||
| Topic |
|
||||
| --- |
|
||||
| `[PREFIX]/apps` |
|
||||
|
||||
!> 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.
|
||||
|
||||
By using this function, users can add or remove native apps, as well as custom apps, from the device.
|
||||
However, it is important to note that custom apps are only temporarily loaded into memory and cannot be added again using this function.
|
||||
To add a custom app again, you must send it to awtrix via mqtt again.
|
||||
|
||||
Additionally, you can rearrange the position of all apps on the device by specifying a new position in the JSON array.
|
||||
This provides flexibility in organizing apps according to personal preference.
|
||||
|
||||
The JSON payload is an array of objects, where each object represents an app to be displayed on awtrix. Each app object contains the following fields:
|
||||
|
||||
`"name"`: The name of the app ("time", "date", "temp", "hum", "bat") are the native apps.
|
||||
For custom apps, use the name you set in the topic. For example, if `[PREFIX]/custom/test` is your topic, then `test` is the name.
|
||||
`"show"`: A boolean indicating whether the app should be shown on the screen or not. If not present, the app is considered active by default.
|
||||
`"pos"`: An integer indicating the position of the app in the list. If not present, the app will be added to the end of the list.
|
||||
|
||||
> You can also just send the information for one app.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name":"time",
|
||||
"show":true,
|
||||
"pos":3
|
||||
},
|
||||
{
|
||||
"name":"date",
|
||||
"pos":0
|
||||
},
|
||||
{
|
||||
"name":"temp",
|
||||
"pos":2
|
||||
},
|
||||
{
|
||||
"name":"hum",
|
||||
"show":true,
|
||||
"pos":0
|
||||
},
|
||||
{
|
||||
"name":"bat",
|
||||
"show":false
|
||||
},
|
||||
{
|
||||
"name":"github",
|
||||
"show":true,
|
||||
"pos":4
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
||||
In this example,
|
||||
- The "time" app is active and should be displayed in position 3.
|
||||
- The "date" app should be displayed in position 0.
|
||||
- The "temp" app should be displayed in position 2.
|
||||
- The "hum" app should be displayed at first position.
|
||||
- The "bat" app is inactive and will be removed,
|
||||
- and the "github" app is active and should be displayed in position 4.
|
||||
|
||||
|
||||
|
||||
|
||||
## Change Settings
|
||||
Change various settings related to the app display.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user