Project

ketra

0.0
No commit activity in last 3 years
No release in over 3 years
A friendly Ruby interface to the Ketra API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 10.0
~> 3.5

Runtime

~> 2.1, ~> 2.1.0
>= 1.3.1, ~> 1.3
 Project Readme

Ketra

Gem Version Build Status Coverage Status

Description

The Ketra gem provides a friendly Ruby interface to the Ketra API

Installation

Add this line to your application's Gemfile:

gem 'ketra'

NOTE: versions 0.3.0+ are only supported for use with Ketra N4 Hubs with 1.15+ firmware

And then execute:

$ bundle

Or install it yourself as:

$ gem install ketra

Usage

In order to use this gem you will need to contact Ketra Support and get assigned a client_id and client_secret

Authentication

Password grant

require 'ketra'
Ketra.client_id = 'YOUR CLIENT ID'
Ketra.client_secret = 'YOUR CLIENT SECRET'
Ketra.client.authorize(:username => 'YOUR DESIGN STUDIO USERNAME', :password => 'YOUR DESIGN STUDIO PASSWORD)
access_token = Ketra.client.access_token

Set Access Token Directly

Ketra.client.authorize(:token => 'YOUR ACCESS TOKEN')

Remote API Configuration

Ketra.client.options[:api_mode] = :remote
Ketra.client.options[:installation_id] = 'YOUR INSTALLATION ID'
Ketra.client.options[:hub_serial] = 'YOUR HUB SERIAL NUMBER'

Local API Configuration

Ketra.client.options[:api_mode] = :local #optional since :local is the default
Ketra.client.options[:hub_serial] = 'YOUR HUB SERIAL NUMBER'

Commands

All commands require authentication and the correct configuration for either remote or local API mode.

Keypad Buttons

Ketra::Commands.activate_button('YOUR KEYPAD NAME', 'YOUR BUTTON NAME')
Ketra::Commands.deactivate_button('YOUR KEYPAD NAME', 'YOUR BUTTON NAME')
Ketra::Commands.push_button('YOUR KEYPAD NAME', 'YOUR BUTTON NAME')

Queries

Ketra::Commands.keypads
Ketra::Commands.groups

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kennyjpowers/ketra. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.