Project

lockitron

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Communicate with a Lockitron
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
~> 4.2
~> 3.3
~> 2.9
~> 1.21

Runtime

~> 0.9
~> 1.0
 Project Readme

#Lockitron Build Status Gem Version Code Climate Coverage Status Dependency Status Documentation

Communicates with the Lockitron API

##Usage

gem install lockitron

If you don't have an OAuth2 token already for the user of your app

auther = Lockitron::Auth.new(client_id: 'YOUR_OAUTH_CLIENT_ID', client_secret: 'YOUR_OAUTH_CLIENT_SECRET', redirect_uri: 'URI_FOR_CODE')
auther.authorization_url #Send your user to this URL to authenticate your app
auther.token_from_code 'code parameter on the redirect uri'
auther.token # Store this, it is your token

To use, you will want a User object

user = Lockitron::User.new('user oauth token')

Get all the user's locks

locks = user.locks

This returns an array of Lock objects, which have a name and uuid method to find the one you want.

Then to actually do something

ruby lock.as user do |l| l.unlock end

For more examples, check the request tests in spec/request or the documentation.

##Contributing to lockitron

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

If you want messages from Faraday, set DEBUG in your environment to true.

##Copyright

Copyright (c) 2012 Kurt Nelson. See LICENSE.txt for further details.