Skip to content
Elixir api client to parrot's flower power api
Elixir
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.gitignore
README.md
mix.exs
mix.lock

README.md

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

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

    credentials = %{
      "grant_type": "<you password goes here>",
      "username": "<username goes here; likely email address>",
      "password": "<chosen password>",
      "client_id": "<same as username>",
      "client_secret": "<passcode given when you sign up for parrots api service>"
    }

    Sample use:

    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.

You can’t perform that action at this time.