apexad/homebridge-sensor-cmd

Async calls with polling support?

Opened this issue · 0 comments

ryrun commented

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".