ElixAtmo is client for the NetAtmo API written in elixir.
get_access_token
: to retrieve an access token for a certain userrefresh_token
: to refresh an expired access tokenget_stations_data
: to retrieve the data from a user weather stations- more to come...
user_data = %UserData{email: "user@email.com", 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)
# 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)
# token = %ElixAtmo.Model.Token{}
{:ok, stations_data} = ElixAtmo.get_stations_data(token.access_token)
def deps do
[
{:elixatmo, git: "git://github.com/simoexpo/ElixAtmo.git", tag: "v0.2.0"}
]
end