awtrix-ts 1.2.0 → 1.3.0
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 +13 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,11 @@ await awtrix.clearIndicator(awtrix.Indicators.UpperRight);
|
|
|
154
154
|
Set moodlight color or temperature.
|
|
155
155
|
|
|
156
156
|
```typescript
|
|
157
|
-
await awtrix.moodlight({
|
|
157
|
+
await awtrix.moodlight({ brightness: 170, kelvin: 2300 });
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
await awtrix.moodlight({ brightness: 170, color: '#FF00FF' });
|
|
158
162
|
```
|
|
159
163
|
|
|
160
164
|
#### clearMoodlight()
|
|
@@ -220,6 +224,14 @@ await setTimeout(2000);
|
|
|
220
224
|
await awtrix.previousApp();
|
|
221
225
|
```
|
|
222
226
|
|
|
227
|
+
#### deleteApp(name: string)
|
|
228
|
+
|
|
229
|
+
Delete a custom app.
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
await clock.deleteApp('myApp');
|
|
233
|
+
```
|
|
234
|
+
|
|
223
235
|
#### Progress Bar Example
|
|
224
236
|
|
|
225
237
|
Display a progress bar using a custom app:
|
|
@@ -268,7 +280,3 @@ await clock.notify({
|
|
|
268
280
|
|
|
269
281
|
- All API calls are asynchronous and return Promises.
|
|
270
282
|
- The class exposes enums for transitions, indicators, and effects for convenience.
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
```
|
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();
|