W-02 ·
Building a TV dashboard that's safe to leave on
I wanted one screen at home that shows the time, the weather and what’s on my calendar, big enough to read from the couch. Slate is that screen. It runs on the TV, and the same pages work on a laptop or a phone. The code is at github.com/yaobuilds/slate.
The clock and the weather were the easy part. The calendar was harder. A TV in the living room is a screen anyone can look at, and I didn’t want it reading my appointments out to the room. So Slate starts in guest mode, where every event just says “Busy”. From the computer that runs it, one key shows the real titles. From a phone or tablet on the Wi-Fi, you enter a six-digit PIN once per device. I’m upfront in the README that this PIN is a lock for one home network, not real security, and that the port should never be forwarded on the router.
Where the secrets live mattered too. My Google Calendar login details go into the Mac’s Keychain, not into the project folder, so they can’t end up in the repository by accident. The same goes for the PIN, my settings and my photos. They’re all in local files that git ignores. The street map on the traffic page needs a free key, and the server keeps it, so the browser never sees it.
The part I like most is the remote. Run Slate with --lan and a phone on the same Wi-Fi can pair with it using a code, then act as a remote: a direction pad, or the full Home screen. The TV pairs with its own code, and until it does, the arrow keys only move around inside Slate.
I kept it plain on purpose. It’s HTML, CSS and JavaScript, with one small Python server that uses nothing outside the standard library. There’s no build step and nothing to install. Clone it, run python3 server.py and open it in a browser. The tests run the same way, against a temporary folder, so they never touch my real PIN or settings.