Comment by skygazer
2 months ago
I did the same a few years ago with a Mac in swift -- listens to the event log via some private ObjC API for camera on and off, and checks for microphones in use. Homekit LED over door turns green if computer is awake/unlocked and not idle more than some threshold. Turns yellow if a physical mic is in use. Turns red if a camera is in use. It sends an indirect request to HomeKit to turn on/off or set the color of the light. (Indirect, because I directly set values on a homebridge synthetic accessory, and use homekit rules to mirror those changes to the actual light, which feels hacky -- talking to homekit directly looked too complicated and entitlement heavy.)
It's worked like a champ. -- although every few major macOS releases, Apple changes the log string for camera on and off events.
No comments yet
Contribute on Hacker News ↗