agnus v0.0.2 Agnus View Source
Agnus
is Sunrise Sunset wrapped in an Elixir supervised GenServer.
Link to this section Summary
Functions
Is the data available for today?
Get the sun info keys available
Get all or some sun information for today
Trigger a refresh of the sun info for today
Link to this section Functions
Is the data available for today?
Examples
iex> Agnus.current?()
iex> true
Get the sun info keys available
Examples
iex> keys = Agnus.keys()
iex> [:sunrise, :sunset] in keys
iex> Enum.count(keys) == 10
Get all or some sun information for today
Examples
iex> info = Agnus.sun_info(:all)
iex> is_map(info)
iex> info = Agnus.sun_info(:astronomical_twilight_begin)
iex> Map.has_key?(info, :astronomical_twilight_begin)
iex> info =
...> Agnus.sun_info([:astronomical_twilight_begin, :astronomical_twilight_begin])
iex> Map.has_key?(info, :astronomical_twilight_begin)
iex> Map.has_key?(info, :astronomical_twilight_end)
Trigger a refresh of the sun info for today
Examples
iex> :ok = Agnus.trigger_sun_info_refresh()
The most recent data is cached and, as such, repeated calls to this function on the same day are no ops.