View Source ReflectOS.Core.Sections.Weather.Provider behaviour (reflect_os_core v0.10.0)

Summary

Types

@type current() :: %{
  icon: atom(),
  sunrise: DateTime.t(),
  sunset: DateTime.t(),
  temperature: number(),
  apparent_temperature: number()
}
@type daily() :: [
  %{
    timestamp: Date.t(),
    icon: atom(),
    temperature_max: number(),
    temperature_min: number()
  }
]
@type error() :: {:error, any()}
@type forecast() :: %{
  current: {:ok, current()} | error(),
  hourly: {:ok, hourly()} | error(),
  daily: {:ok, daily()} | error()
}
@type hourly() :: [%{timestamp: DateTime.t(), icon: atom(), temperature: number()}]

Callbacks

@callback fetch_weather(any()) :: forecast()
@callback new(%{latitude: number(), longitude: number(), api_key: String.t()}) :: any()

Functions

Link to this function

daytime?(arg1, timestamp)

View Source
Link to this function

get_sunrise_sunset(arg, date)

View Source