samemory / homebridge-eufy-security

Work in progress
Apache License 2.0
97 stars 14 forks source link

Adding lock/unlock support for T8520 (#354) #364

Closed icortes95 closed 2 years ago

icortes95 commented 2 years ago

Now that the eufy-security-client has been updated, I bumped it to the latest version (1.6.6) and have added support for un/locking the Smart Lock Touch & Wi-Fi (T8520) through HomeKit. Addresses #354.

I have tested that both lock and unlock work. Also, notifications for when the events happen are typically triggered right away now, but I think that's all due to the changes in the eufy-security-client and not anything I did.

This is my first time contributing to an open source project, so please let me know if I'm not going about this the right way. Especially regarding the package-lock.json file. That was just what was generated during my development/testing and I'm not sure if all those changes are supposed to be included.

github-actions[bot] commented 2 years ago

We do not accept PRs on the master branch. Please submit your PR through the dev branch instead of the master one, thanks. If you have any questions, please feel free to contact us.

kunwarsethi commented 2 years ago

Tried adding these changes in "/usr/local/lib/node_modules/homebridge-eufy-security/package-lock.json", "package.json" and "/usr/local/lib/node_modules/homebridge-eufy-security/dist/accessories/SmartLockAccessory.js" but I get an error when I try to use the lock -

TypeError: Cannot read properties of null (reading '0') at P2PClientProtocol.incLockSequenceNumber (/usr/local/lib/node_modules/homebridge-eufy-security/node_modules/eufy-security-client/src/p2p/session.ts:1620:78) at Station.lockDevice (/usr/local/lib/node_modules/homebridge-eufy-security/node_modules/eufy-security-client/src/http/station.ts:3192:42) at processTicksAndRejections (node:internal/process/task_queues:96:5)

icortes95 commented 2 years ago

@kunwarsethi I'm not sure you can just replace files like that. I had to pull my fork of homebridge-eufy-security, make the changes to the package.json and src/accessories/SmarLockAccessory.ts. Then do an npm install, npm run build to build your version. Finally, run npm link in your plugin directory and enable -D debug mode in the Homebridge settings so Homebridge can pick up your version,

lenoxys commented 2 years ago

hey thanks for your contribution. Can you sync changes from beta branch and then push only the src/accessories/SmartLockAccessory.ts

thanks!

icortes95 commented 2 years ago

Hi! I'm a bit confused as to what I have to do. Maybe it stems from the face that I created this PR from master instead of beta to begin with.

Should I update my beta branch and then merge it into my master branch (since that's where this PR is coming from)? Then push those changes which will show up here?

Sorry if these are really noob questions, for some reason we use different version control software at work instead of git, so I'm not very familiar with the standard procedure.

lenoxys commented 2 years ago

Hi, no worries. We're working on the beta release ATM. Could you just use the beta branch, push your modifications and then PR from your beta to ours ?

icortes95 commented 2 years ago

Hi, no worries. We're working on the beta release ATM. Could you just use the beta branch, push your modifications and then PR from your beta to ours ?

@lenoxys Alright, hopefully I understood and did it correctly. I made a new PR #365 with just the src/accessories/SmartLockAccessory.ts change from my beta branch to this repo's beta branch.

Let me know if something doesn't look right!

lenoxys commented 2 years ago

Thanks closing this one