Open ryrun opened 1 year ago
I know it is about a year later. However, if you are still using this plugin with your hack, could you make a Pull request with the change so I can review it?
My dirty hack version can be found here: https://github.com/ryrun/homebridge-sensor-cmd. I switched it to JavaScript because I directly modified the JS files. If needed, I could try a TypeScript version once I have a bit more time.
I used your plugin to do ping to check if a device is active or not, but it seems the "get" function of services for homebridge v1.6.1 doesn't get called in the background regularly, so motion detection is not triggered / get missed. Especially when you want to use it for automation.
I manually "hacked" the .js for to do Async requests and it's working fine now. Maybe you can implement something like this? https://github.com/homebridge/homebridge-plugin-template/blob/d0bca523f5cd56f68d9d1e9b21ae20389bbcb2e5/src/platformAccessory.ts#L80C1-L92C4
This would also fix warnings, when the shell command is "slow".