Giter VIP home page Giter VIP logo

kevo_ex's Introduction

kevo_ex

An Elixir client library for Kevo's reverse engineered web API.

Kevo locks were launched by Kiwkset in 2016 and discontinued in 2022. While they're unlikely to receive support for Seam, the existing web API should (hopefully) remain (relatively) stable.

Installation

Add :kevo_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:kevo_ex, "~> 0.2.0"}
  ]
end

Documentation is available on HexDocs and may also be generated with ExDoc.

Usage

Add Kevo to your app's supervision tree:

kevo_opts = [
  name: Kevo,
  username: "username",
  password: "password",
  ws_callback_module: YourHandlerModule # optional
]

children = [
  {Kevo, kevo_otps}
]

Or start the client dynamically:

Kevo.start_link([name: Kevo, username: "username", password: "password"])

Configuration

  • :name - Alias of the top-level supervisor. Can be provided if you intend to run multiple instances of kevo_ex. Defaults to Kevo.

  • :username - Your Kevo username (required).

  • :password - Your Kevo password (required).

  • :ws_callback_module - Websocket callback module. Defaults to nil.

API calls

  • Kevo.get_locks/0 - Retrieves all locks visible to the logged in user.

  • Kevo.get_lock/1 - Retrieves the given lock's state.

  • Kevo.lock/1 - Locks the given lock.

  • Kevo.unlock/1 - Unlocks the given lock.

  • Kevo.get_events/3 - Gets the provided lock's event history. Follows the frontend's paging behavior.

A name atom can be provided as an additional argument. Defaults to Kevo.

Websocket events

To receive websocket events, provide a Kevo.Handler compliant module using the ws_callback_module option. When a message is recevied, handle_event/1 will be invoked, passing a map of the received JSON. See the page on example responses.

Usage notes

  • API calls are made to be as concurrently as possible.
  • Kevo's websocket accepts no messages and is receive only.
  • The websocket will only be opened if ws_callback_module is provided.
  • This library is unopinionated about how you queue or broker events.

Acknowledgments

Special thanks to the following:

kevo_ex's People

Contributors

moosieus avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.