awtrix-ts 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -6,6 +6,12 @@ TS wrapper for [Awtrix API](https://blueforcer.github.io/awtrix3/#/api).
|
|
|
6
6
|
|
|
7
7
|
The `Awtrix` class provides a TypeScript interface for interacting with the Awtrix device API. It supports device control, settings management, notifications, app switching, indicators, moodlight, and more.
|
|
8
8
|
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i --save awtrix-ts
|
|
13
|
+
```
|
|
14
|
+
|
|
9
15
|
### Usage
|
|
10
16
|
|
|
11
17
|
```typescript
|
|
@@ -224,6 +230,14 @@ await setTimeout(2000);
|
|
|
224
230
|
await awtrix.previousApp();
|
|
225
231
|
```
|
|
226
232
|
|
|
233
|
+
#### deleteApp(name: string)
|
|
234
|
+
|
|
235
|
+
Delete a custom app.
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
await clock.deleteApp('myApp');
|
|
239
|
+
```
|
|
240
|
+
|
|
227
241
|
#### Progress Bar Example
|
|
228
242
|
|
|
229
243
|
Display a progress bar using a custom app:
|
|
@@ -272,7 +286,3 @@ await clock.notify({
|
|
|
272
286
|
|
|
273
287
|
- All API calls are asynchronous and return Promises.
|
|
274
288
|
- The class exposes enums for transitions, indicators, and effects for convenience.
|
|
275
|
-
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
```
|
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ declare class Awtrix {
|
|
|
79
79
|
launchApp(name: string): Promise<void>;
|
|
80
80
|
nextApp(): Promise<void>;
|
|
81
81
|
previousApp(): Promise<void>;
|
|
82
|
+
deleteApp(name: string): Promise<void>;
|
|
82
83
|
get(endpoint: string): Promise<any>;
|
|
83
84
|
post(endpoint: string, data?: object): Promise<void>;
|
|
84
85
|
}
|
package/dist/index.js
CHANGED
|
@@ -133,6 +133,9 @@ class Awtrix {
|
|
|
133
133
|
async previousApp() {
|
|
134
134
|
await this.post('previousapp');
|
|
135
135
|
}
|
|
136
|
+
async deleteApp(name) {
|
|
137
|
+
await this.post(`custom?name=${name}`);
|
|
138
|
+
}
|
|
136
139
|
async get(endpoint) {
|
|
137
140
|
const response = await fetch(`${this.url}/${endpoint}`);
|
|
138
141
|
const data = await response.json();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "awtrix-ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "TypeScript API for Awtrix LED Matrix Display",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,5 +27,19 @@
|
|
|
27
27
|
"eslint": "^9.39.2",
|
|
28
28
|
"eslint-config": "github:7digital/eslint-config",
|
|
29
29
|
"typescript": "^5.9.3"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"awtrix",
|
|
33
|
+
"led",
|
|
34
|
+
"matrix",
|
|
35
|
+
"api",
|
|
36
|
+
"typescript",
|
|
37
|
+
"clock",
|
|
38
|
+
"ulanzi",
|
|
39
|
+
"tc001",
|
|
40
|
+
"smart display",
|
|
41
|
+
"iot",
|
|
42
|
+
"pixel-clock",
|
|
43
|
+
"pixel-display"
|
|
44
|
+
]
|
|
31
45
|
}
|