This is really out of date. You probably don't want to use this!!
Lockitron lets you unlock your front door from anywhere in the world, including your smartphone. We have an iPhone app, an Android app, a webapp, a mobile web app, a REST API, and now, a RubyGem.
This is a very early version of the gem. With it, you can lock, or unlock Lockitrons by their name.
You need two things for this gem. Firstly, you need a Lockitron-powered door lock, which you can buy at https://lockitron.com. Secondly, you'll need an access token. If you'll only use this for yourself, then go grab your access token. Right now, the gem doesn't handle authorization, so you'll need to manually switch out access tokens. We use OAuth2, and we have a guide on authenticating with it.
To use the Lockitron gem or as a shell script, you'll need to set an access token. You can set it in Ruby or in bash, and it'll work either way. Although, I recommend that you set the access token as an environment variable. I've shown how to do that below
Storing the access token as an environment variable: (Remember to replace MY_ACCESS_TOKEN with your access token!)
echo "export LOCKITRON_ACCESS_TOKEN=MY_ACCESS_TOKEN" >> ~/.bashrc && exec $SHELL
Lockitron::Locks.access_token = MY_ACCESS_TOKEN
You can lock or unlock your Lockitron-powered locks, and list the available locks.
To lock, run:
lockitron lock LOCK_NAME
To unlock, run:
lockitron unlock LOCK_NAME
To list all available locks, run:
lockitron list
You can lock or unlock your locks by their name.
To unlock by name, run:
Lockitron::Locks.unlock("Lock Name")
To lock by name, run:
Lockitron::Locks.lock("Lock Name")
To list all available locks, run:
Lockitron::Locks.list