Tehama Wireless API Elixir Client

tehama_client_ex is an elixir client library for interacting with the Tehama Wireless API.

You can view the API documentation here.

Build StatusModule VersionHex DocsTotal DownloadLicenseLast Updated

Documentation

HEX docs for this repository.

Installation

If available in Hex, the package can be installed by adding tehama_client_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:tehama_client_ex, "~> 0.6.0"}
  ]
end

Usage

Authenticate

Basic usage is to authenticate to get a token...

# on success auth will be %TehamaClient.Auth{token: "usertoken...."}
auth = TehamaClient.auth!("username", "password")

Sites

Then you can get a list of Site objects...

# on success sites will be a list of %TehamaClient.Site{}
sites = TehamaClient.site_list(auth)

Devices

And finally using a site, you can get a list of Device objects...

# on success sites will be a list of %TehamaClient.Device{}
readings = TehamaClient.report_data(auth, List.first(sites))

Readings

Using a device you can get a list of device Reading objects...

# readings will be a list of %TehamaClient.Reading{}
%TehamaClient.Device{readings: readings} = List.first(readings)

Examples

This repository comes with some examples. The examples require some environment variables to be set.

To run an example, go to the repository and run these command line commands:

Change Log

Version 0.6.0

Version 0.5.0

Version 0.4.0

Version 0.3.0

Version 0.2.0