Lid Light
There's a sensor inside your MacBook that knows the exact angle of your lid. Apple apparently uses it to help their in-store employees set the lid to a specific angle.
The other day I saw someone use this angle sensor to build a musical instrument. I thought that was hilarious, but I am not a musical person. So instead I decided to make it control my lights as a dimmer.
So I built it.
Lid Light is a small native macOS app that reads the lid angle via IOKit. It then maps that angle to a brightness value and sends it to Home Assistant over the local network. Open the lid wider, lights go up. Close it, they dim. Close the laptop entirely and it turns them all off.
One tricky bit was to not flood Home Assistant with requests. So the app polls the sensor at 10Hz and has a throttling layer that bundles small changes together and only fires when something meaningful happens.

Is this some revolution in terms of Smart Home-iness? Absolutely not. It's incredibly stupid and there are better ways to link lights to your laptop.
But it's stupid and fun. And it kept me entertained for half an hour building it and then some giggling for a minute testing it.
Worth it.