Closed nriley closed 7 years ago
The script should just run in the background. That 1 second timeout is just for giving response back to Siri. If you are using Siri and it doesn't get any response back in 1 or 2 seconds, Siri will think that the device is not responding.
I manually changed it in the index.js to 4000, and Siri has no problem with that. It's the same delay for some other homebridge platforms I have, and Siri is always happy with delays.
Hi!
I've implemented custom timeouts in this pull request: https://github.com/luisiam/homebridge-cmdswitch2/pull/17
Pull request merged
One of the things I expose via homebridge is my desktop Mac's screen, and the only easy way I'm aware to script waking it up is by setting a power assertion with a 1 second timeout — which means the process takes at least one second to run. I tried many many ways to run this in the background (e.g. using
&
, ordisown
, etc.) but all of them run into the cmdswitch2 timeout. I did eventually make it work by putting caffeinate into a launchd job, so if anyone else sees this, my switch looks like this:where the launchd plist looks like:
but this took quite a while to figure out. Either a way to set the timeout to something longer than 1 second, or a way to just let the script run in the background would be appreciated.
Thanks!