Skip to content

simoexpo/ElixAtmo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElixAtmo version Build Status Coverage Status codebeat badge

What is it?

ElixAtmo is client for the NetAtmo API written in elixir.

Supported API

  • get_access_token: to retrieve an access token for a certain user
  • refresh_token: to refresh an expired access token
  • get_stations_data: to retrieve the data from a user weather stations
  • more to come...

Examples

get_access_token:
user_data = %UserData{email: "[email protected]", password: "password"}
app_data = %AppData{app_id: "app_id", client_secret: "secret"}
scopes = [ElixAtmo.Model.TokenScope.read_station()]
{:ok, token} = ElixAtmo.get_access_token(user_data, app_data, scopes)
refresh_access_token:
# token = %ElixAtmo.Model.Token{}
app_data = %AppData{app_id: "app_id", client_secret: "secret"}
{:ok, stations_data} = ElixAtmo.refresh_access_token(token.refresh_token, app_data)
get_stations_data:
# token = %ElixAtmo.Model.Token{}
{:ok, stations_data} = ElixAtmo.get_stations_data(token.access_token)

Installation

def deps do
  [
    {:elixatmo, git: "git://github.com/simoexpo/ElixAtmo.git", tag: "v0.2.0"}
  ]
end