-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: use the callback instead of polling #62
Comments
This is a Home Assistant issue rather than a pynuki one. |
There is no need for an extra local webserver. The Nuki integration for Home Assistant would just have to create an endpoint / webhook within the Home Assistant install where the callbacks can be send and then process them. Not having HTTPS is not a real issue here as probably 99% of the users will be running Home Assistant within the same LAN as the Nuki Bridge. The current integration (as most WiFi integrations in HA) does not use HTTPS as well so why see this as limitation for the callback. Anyway, seeing the reaction this is not something that is going to happen. I have no experience with coding in Python so it's not something I can pick up myself. Looks like I'm sticking to my own javascript integration. |
I didn't want to be dismissive there. This FR of yours is just out of scope in regards to pynuki. Please do open an issue on home-assistant/core for this ;) |
Sure no problem. For people who stumble upon this, the feature request can be found here: https://community.home-assistant.io/t/nuki-use-callbacks-instead-of-unreliable-polling/229064 |
As far as I can tell this library is using a polling mechanism to get the lockState. As the resource from the bridge are limited this often results in 503 errors. A better approach would be to use the callback mechanism. You can set an endpoint which the bridge calls when a change in state has been detected. This is more reliable, gives faster feedback and reduces the network traffic and load on the bridge.
https://developer.nuki.io/page/nuki-bridge-http-api-1-12/4#heading--callback
It would be a big improvement to have this in Home Assistant.
If you know any javascript you could have a look at this library which was initially developed by me and uses the callbacks: https://github.com/pfreguia/nuki.homey . I can answer questions about this all but I dont know Phyton so I cant actually code it.
The text was updated successfully, but these errors were encountered: