I built a similar thing using Bluetooth to a ESP32.
The hard part is reliably detecting camera status. I’m currently using a utility called Oversight, but it is event-based and the dodginess of the Bluetooth connection means the device gets out of sync.
The python script takes a different approach, so I’m going to check that out.