Skip to content
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

Add support for Ring Alarm #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joeyberkovitz
Copy link

No description provided.

@mrose17
Copy link
Collaborator

mrose17 commented Oct 25, 2018

as noted in #26 (comment), et. seq., i am thinking that we should have a seperate repo for this, viz., https://github.com/homespun/ring-alarm

@davglass
Copy link
Owner

@mrose17 To make sure they stay in sync, I could export the main class and you could require and extend it with the new attributes. Then if I change up the authentication or fix a bug they don't have to be done in both places..

@mrose17
Copy link
Collaborator

mrose17 commented Oct 25, 2018

@davglass - that would work.

@joeyberkovitz
Copy link
Author

Sounds good. In that case, would it make sense to store the oauth token from the auth functions so that the extended classes can use it without having to replace the auth functions?

@davglass
Copy link
Owner

@joeyberkovitz Maybe I missed something, but the token should be stored on the class already:

https://github.com/davglass/doorbot/blob/master/doorbot.js#L296

@joeyberkovitz
Copy link
Author

That's a token, but not the original oauth token. This PR store the oauth token as well as the token used by the API line 287. To access the alarm APIs, the original oauth token is needed.

@davglass
Copy link
Owner

@mrose17 @joeyberkovitz I pushed up a branch in #37 that you can test for extending. Let me know if I need to refactor anything else to help.

@joeyberkovitz
Copy link
Author

Thanks, Will test it over the weekend and let you know.

@mrose17
Copy link
Collaborator

mrose17 commented Oct 26, 2018

@joeyberkovitz - can you do me a favor and try out https://github.com/homespun/ring-alarm, viz.,

DEBUG=ring-alarm.station RING_USERNAME=... RING_PASSPHRASE=... node test.js

and let it run for a day or so until the websocket closes. i'm seeing an issue in re-establishing the websocket. i'm not quite sure how to solve it... thanks!

@joeyberkovitz
Copy link
Author

Running. Will let you know how it goes. Suspect that there may be a need to refresh the initial Oauth token and request a new alarm token.

@mrose17
Copy link
Collaborator

mrose17 commented Oct 26, 2018

@joeyberkovitz - many thanks. i think you're on the right track!

Switch to OAuth as old authentication method has been disabled
Implements auth cache file with the same format as https://github.com/joeyberkovitz/ring-alarm, so OAuth tokens can be shared across the two projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants