You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-29
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,7 @@ Apps running on Pixbyt have none of these limitations:
140
140
Pixbyt lets you realize your wildest Tidbyt dreams by making it easy to:
141
141
-**build** advanced Tidbyt apps,
142
142
-**install** advanced apps built by the community,
143
-
-**manage**app configurations and schedules,
143
+
-**manage**multiple Tidbyts and apps,
144
144
-**package** apps together in a [Docker](https://www.docker.com/) image, and
145
145
-**launch** the app server using [Docker Compose](https://docs.docker.com/compose/).
146
146
@@ -178,8 +178,7 @@ Codespaces will automatically install the necessary dependencies and launch you
178
178
179
179
1. Click the green "Use this template" button at the top of this page
180
180
1. Choose "Open in a codespace" and wait for the codespace to start
181
-
1. Update `.env` with your configuration:
182
-
-`HELLO_WORLD_NAME`: Optionally, replace `world` with your own name.
181
+
1. Optionally, update the `HELLO_WORLD_NAME` environment variable in `.env` to replace `world` with your own name.
183
182
1. Render app to a WebP image file:
184
183
185
184
```bash
@@ -189,9 +188,8 @@ Codespaces will automatically install the necessary dependencies and launch you
189
188
The image will be created at `output/hello-world/<timestamp>.webp`.
190
189
The exact path is also printed in the command output.
191
190
1. Render app to your Tidbyt:
192
-
1. Update `.env` with your configuration:
193
-
- `TIDBYT_DEVICE_ID`: Find your Device ID in the Tidbyt mobile app under Settings > General > Get API Key.
194
-
- `TIDBYT_TOKEN`: Find your API Token in the Tidbyt mobile app under Settings > General > Get API Key.
191
+
1. Find your Device ID and Key in the Tidbyt mobile app under Settings > General > Get API Key.
192
+
1. Update the `TIDBYT_DEVICE_ID` and `TIDBYT_KEY` environment variables in`.env`.
195
193
1. Render the `hello-world` app and send it to your Tidbyt (in the foreground):
196
194
197
195
```bash
@@ -224,8 +222,7 @@ If you haven't launched a codespace yet:
224
222
225
223
1. Click the green "Use this template" button at the top of this page
226
224
1. Choose "Create a new repository"
227
-
2. Create a new (private) repo
228
-
225
+
1. Create a new (private) repo
229
226
1. Clone your new repository and enter the new directory:
230
227
231
228
```bash
@@ -235,27 +232,72 @@ If you haven't launched a codespace yet:
235
232
236
233
</details>
237
234
238
-
### 2. Configure your Tidbyt
239
-
240
-
1. If no `.env` configuration file exists yet, create one from the sample:
235
+
### 2. Configure Pixbyt
241
236
237
+
1. If the `.env` configuration file doesn't exist yet, create it from the sample:
242
238
```bash
243
239
cp .env.sample .env
244
240
```
241
+
1. Update the `TZ` environment variable in`.env` to your ["TZ" timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). This is used by many apps that show the (relative) date and time.
242
+
243
+
#### Option A: Configure just one Tidbyt
244
+
245
+
1. Find your Device ID and Key in the Tidbyt mobile app under Settings > General > Get API Key.
246
+
1. Update the `TIDBYT_DEVICE_ID` and `TIDBYT_KEY` environment variables in`.env`.
247
+
248
+
<details>
249
+
<summary>
250
+
251
+
#### Option B: Configure multiple Tidbyts
252
+
253
+
</summary>
254
+
255
+
1. If `devices.yml` doesn't exists yet, create it from the sample:
256
+
```bash
257
+
cp devices.yml.sample devices.yml
258
+
```
259
+
1. For each device:
260
+
1. Add the device to `devices.yml` under `devices:`:
261
+
```yaml
262
+
devices:
263
+
# ...
264
+
- name: <name>
265
+
id: $TIDBYT_<NAME>_DEVICE_ID
266
+
key: $TIDBYT_<NAME>_KEY
267
+
```
268
+
269
+
1. Replace `<name>` with the room name or another identifier.
270
+
1. Replace `<NAME>` with the uppercased version thereof.
271
+
272
+
For example:
273
+
274
+
```yaml
275
+
devices:
276
+
# ...
277
+
- name: office
278
+
id: $TIDBYT_OFFICE_DEVICE_ID
279
+
key: $TIDBYT_OFFICE_KEY
280
+
```
281
+
1. Find your Device ID and Key in the Tidbyt mobile app under Settings > General > Get API Key.
282
+
1. Add the `TIDBYT_<NAME>_DEVICE_ID` and `TIDBYT_<NAME>_KEY` environment variables in `.env`.
283
+
For example:
245
284
246
-
1. Update `.env` with your configuration:
247
-
- `TZ`: Find your ["TZ" timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). This is used by many apps that show the (relative) date and time.
248
-
- `TIDBYT_DEVICE_ID`: Find your Device ID in the Tidbyt mobile app under Settings > General > Get API Key.
249
-
- `TIDBYT_TOKEN`: Find your API Token in the Tidbyt mobile app under Settings > General > Get API Key.
285
+
```bash
286
+
TIDBYT_OFFICE_DEVICE_ID="foo-bar-baz-qux-abc"
287
+
TIDBYT_OFFICE_KEY="<key>"
288
+
```
289
+
290
+
</details>
250
291
251
292
### 3. Add your apps
252
293
253
-
The most important files in your Pixbyt repo (and likely the only ones you'll want to edit) are the following, which define the apps, their configuration, and their schedules:
294
+
The most important files in your Pixbyt repo (and likely the only ones you'll want to edit) are the following, which define the apps, their configuration, and their apps:
254
295
255
296
```bash
256
297
pixbyt
257
-
├─ apps.yml # Schedules
258
298
├─ .env # Configuration
299
+
├─ apps.yml # App schedules
300
+
├─ devices.yml # Optional: Devices
259
301
└─ apps
260
302
└─ <app> # One directory for each app
261
303
├─ <app>.star # Main Pixlet applet
@@ -364,44 +406,49 @@ Skip ahead to step 4 to build and launch the app server.
364
406
365
407
#### 3.2. Configure the app
366
408
367
-
1. Add the app's update schedule to `apps.yml` under `schedules:`:
409
+
1. Add the app and its update schedule to `apps.yml` under `apps:`:
368
410
369
411
```yaml
370
-
schedules:
412
+
apps:
371
413
# ...
372
414
- name: <app>
373
-
interval: '<cron schedule expression>'
374
-
job: <app>
415
+
schedule: '<cron expression>'
416
+
# If you have multiple Tidbyts defined in `devices.yml`, you can optionally filter them by name:
417
+
# devices: [<device>]
375
418
```
376
419
377
420
1. Replace `<app>` with the name of the app.
378
-
1. Replace `<cron schedule expression>` with an appropriate [cron schedule expression](https://crontab.guru/):
421
+
1. Replace `<cron expression>` with an appropriate [cron expression](https://crontab.guru/):
379
422
380
423
- Clocks should use `* * * * *` to update every minute, so that the displayed time is always as fresh as possible.
381
424
- Apps that display a random entry from a list can use `*/5 * * * *` to update every 5 minutes, so that a fresh entry is shown on every app rotation.
382
425
- Apps that show the latest data from some API can use `*/15 * * * *` to update every 15 minutes, or something else appropriate for your data source and the expected data freshness.
383
426
- Apps that will always generate the same image can use `0 0 * * *` to update every day at midnight, just to be sure.
384
427
385
-
(A recommended schedule is typically documented in the app's `README`.)
428
+
A recommended schedule is typically documented in the app's `README`.
429
+
1. Optionally, replace `<device>` with the name of a device defined in`devices.yml` to only send the app to that device. By default, the app will be sent to all devices.
386
430
387
431
For example:
388
432
389
433
```yaml
390
-
schedules:
434
+
apps:
435
+
# ...
391
436
- name: hello-world
392
-
interval: '0 ****' # On the hour
393
-
job: hello-world
437
+
schedule: '0/15 * * * *'#Every 15 minutes
438
+
devices: [office] # Optional
394
439
```
395
440
396
-
1. If the app requires configuration, update `.env`:
441
+
Note that examples in apps' `README`s sometimes use `schedules` and `interval` keys instead of `apps` and `schedules`. They are equivalent and both are supported, but the latter is preferred.
442
+
443
+
1. If the app requires configuration, add its environment variables to `.env`:
397
444
398
445
For any config key the app defines under `app_config:` in its `pixbyt.yml` file, add a value for the uppercase environment variable:
399
446
400
447
```bash
401
448
<APP>_<KEY>="<value>"
402
449
```
403
450
404
-
(The exact keys are typically documented in the app's `README`.)
451
+
The exact environment variables are typically documented in the app's `README`.
405
452
406
453
For example:
407
454
@@ -484,7 +531,7 @@ Note that you'll need to do this each time your apps or their schedules change a
484
531
```
485
532
486
533
Your Pixbyt app server is now running, and your apps will update on schedule!
487
-
You can find logs for your apps under `logs/<app>/`.
534
+
You can find logs for your apps under `logs/apps/<app>/`.
0 commit comments