mickgiles / homebridge-vesync

Homebridge plugin for vesync WiFi Power Outlets
6 stars 4 forks source link

This plugin slows down Homebridge #12

Open rossfarinella opened 2 years ago

rossfarinella commented 2 years ago

Homebridge v1.3.8 homebridge-vesync-v2 v2.3.8 Node.js Version v14.15.1 Npm Version v6.14.9

[homebridge-vesync-v2] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.

ianepperson commented 1 year ago

I see the same thing in my logs.

Homebridge v1.6.1 homebridge-vesync-v2 v2.3.9 Node.js Version v18.18.0

ianepperson commented 1 year ago

I'm guessing that these returns can sometimes be slow and need to be performed differently: https://github.com/mickgiles/homebridge-vesync/blob/9a90a0a30f00060ebbb93e8f332f56afe2f657fd/lib/client.js#L122 https://github.com/mickgiles/homebridge-vesync/blob/9a90a0a30f00060ebbb93e8f332f56afe2f657fd/lib/client.js#L59

This might be a good example to follow, but it's not clear to me on how to alter this plugin to reflect the example: https://github.com/homebridge/homebridge-examples/blob/9b2b10f9c1a5768fc35c643002367bb5e2174ce3/independent-platform-example-typescript/src/independent-platform.ts#L72

I don't have the switch currently plugged in (holiday lights), which might be why I'm experiencing this. I can just disable this plugin for now.