https://github.com/korbin73/flowerpower
Elixir api client to parrot's flower power api
https://github.com/korbin73/flowerpower
elixir parrot-flower
Last synced: 10 months ago
JSON representation
Elixir api client to parrot's flower power api
- Host: GitHub
- URL: https://github.com/korbin73/flowerpower
- Owner: Korbin73
- Created: 2015-09-26T23:22:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-16T16:17:17.000Z (over 10 years ago)
- Last Synced: 2025-08-27T17:57:29.262Z (10 months ago)
- Topics: elixir, parrot-flower
- Language: Elixir
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Flower Power
===========
Parrot's flower power cloud service api wrapper written in Elixir.
Before you get started, you will need an oauth token from:
[parrot api](https://apiflowerpower.parrot.com/api_access/signup)
Usage
-----------------
1. To get the data from parrot's webservice it simply needs the credentials and a date range. Below
are details about the credentials
```elixir
credentials = %{
"grant_type": "",
"username": "",
"password": "",
"client_id": "",
"client_secret": ""
}
```
Sample use:
```elixir
defmodule App do
def get_yesterdays_date do
Date.now
|> Date.subtract(Time.to_timestamp(2, :days))
|> DateFormat.format("{ISO}")
|> pluck_date
end
def get_todays_date do
Date.now
|> DateFormat.format("{ISO}")
|> pluck_date
end
defp pluck_date({:ok, date}), do: date
end
FlowerPower.Api.get_garden_data(credentials, App.get_yesterdays_date, App.get_todays_date)
```
2. The calculate module provides transformations using the data graph from the service.