bropat / eufy-security-client

This shared library allows to control Eufy security devices by connecting to the Eufy cloud servers and local/remote stations over p2p.
MIT License
467 stars 67 forks source link

Homebridge plugin development #12

Closed deanlyoung closed 3 years ago

deanlyoung commented 3 years ago

@bropat I am working on porting it over here: https://github.com/deanlyoung/homebridge-eufy-security, but it looks like a few methods and interfaces changed between eufy-security-client and the former eufy-node-client...

Do you have any recommendations for these portions:

Originally posted by @deanlyoung in https://github.com/bropat/eufy-security-client/issues/7#issuecomment-822108580

schliemann commented 3 years ago

As I read your homebridge plugin you never call authenticate on the api. And therefore hubs are never populated. At least that's how I read the eufy-security-client library.

schliemann commented 3 years ago

Same with devices not being set. For reference bropat's other project utilizing eufy-security-client might be helpful - https://github.com/bropat/ioBroker.eufy-security

Can you elaborate on your issues for line 10 and 92?

deanlyoung commented 3 years ago

Yeah, I haven't implemented everything yet, but I was starting by using https://github.com/birkir/homebridge-plugin-eufy-security as a template. However, it's built on https://github.com/JanLoebel/eufy-node-client, which has been deprecated in favor of eufy-security-client. It appears that it has a different structure, which is fine, but it's a bit beyond me in terms of what has been changed / implemented differently.

In VSCode, I get errors, particularly at 92, where it says that createPushCredentials is Private, so I can't call it here.

schliemann commented 3 years ago

I'm far from an expert in typescript or even this library. I can take a look tonight however.

bropat commented 3 years ago

@deanlyoung Check out my latest project: eufy-security-ws. This already uses the new high-level class EufySecurity, which is available since eufy-security-client 0.8.0 and provides a very simplified interface. In the next days I will try to publish a first example documentation.

schliemann commented 3 years ago

@deanlyoung We have the api running on https://github.com/samemory/homebridge-eufy-security-control changing guard mode. You are welcome to take a peak or even better help extend the features of this repo.