kmcphillips / tidbyt-apps

Apps for Tidbyt using pixlet and Sarlark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tidbyt Apps

Use pixlet to build apps for Tidbyt using Starlark.

Getting started

Reference

Development

The pixlet executable is included in the project, so you can develop with:

$ bin/pixlet serve --watch src/example.star

Then visit http://localhost:8080/

fuzzy_clock_data.star

This Starlark file for a clock is generated from fuzzy_clock_data.star.erb by running:

ruby bin/fuzzy_clock_data.rb

It interpolates the DATA dict in the file so that it can use Ruby to fetch and format data in ways that Starlark cannot. It also uses a local file cache with a TTL for each value to prevent hitting APIs too often.

Buliding Pixlet for Raspberry Pi

Assuming go and npm are installed:

cd ~/pixlet
npm install && npm run build && PATH=$PATH:/usr/local/go/bin GOPATH=$HOME/golang make build
cp pixlet ~/tidbyt-apps/bin/pixlet_linux_arm32

https://github.com/drudge/homebridge-tidbyt/wiki#how-do-you-install-pixlet-on-the-raspberry-pi tidbyt/pixlet#700

Pushing to Tidbyt

Include a .env file in the root of the project that includes:

TIDBYT_DEVICE_ID=the-device-id
TIDBYT_TOKEN=1lkjdf09jasdlfkj23094lslkdfj0.9234nf

Those values can be found in the Tidbyt mobile app.

Then to push to the device:

$ bin/push src/example.star

About

Apps for Tidbyt using pixlet and Sarlark


Languages

Language:Starlark 38.9%Language:Ruby 29.3%Language:HTML 28.2%Language:Shell 3.6%