SolarEdge.PowerReading (solar_edge v0.0.1)
Summary
Functions
Converts a Map of API power data to a PowerReading
Functions
Link to this function
new_from_api(data, site)
Converts a Map of API power data to a PowerReading
iex> location = %SolarEdge.Location{time_zone: "Europe/Berlin"} iex> site = %SolarEdge.Site{location: location} iex> {:ok, reading} = SolarEdge.PowerReading.new_from_api(%{date: "2023-10-18 00:15:00", value: 3}, site) iex> reading.date_time #DateTime<2023-10-18 00:15:00+02:00 CEST Europe/Berlin> iex> reading.value 3
Now with an ambiguous time
iex> {:ok, reading} = SolarEdge.PowerReading.new_from_api(%{date: "2023-10-29 02:00:00", value: 3}, site) iex> reading.date_time #DateTime<2023-10-29 02:00:00+02:00 CEST Europe/Berlin>
Link to this function
new_from_api!(data, site)
Link to this function