Package io.openems.edge.meter.discovergy
Class DiscovergyApiClient
- java.lang.Object
-
- io.openems.edge.meter.discovergy.DiscovergyApiClient
-
public class DiscovergyApiClient extends java.lang.Object
Client for the Discovergy API (https://api.discovergy.com/docs/).
-
-
Constructor Summary
Constructors Constructor Description DiscovergyApiClient(java.lang.String email, java.lang.String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonArray
getFieldNames(java.lang.String meterId)
Returns the available measurement field names for the specified meter.com.google.gson.JsonObject
getLastReading(java.lang.String meterId, Field... fields)
Returns the last measurement for the specified meter.com.google.gson.JsonArray
getMeters()
Returns all meters that the user has access to.
-
-
-
Method Detail
-
getMeters
public com.google.gson.JsonArray getMeters() throws OpenemsError.OpenemsNamedException
Returns all meters that the user has access to.See https://api.discovergy.com/docs/ for details.
- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getFieldNames
public com.google.gson.JsonArray getFieldNames(java.lang.String meterId) throws OpenemsError.OpenemsNamedException
Returns the available measurement field names for the specified meter.See https://api.discovergy.com/docs/ for details.
- Parameters:
meterId
- the Discovergy Meter-ID- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getLastReading
public com.google.gson.JsonObject getLastReading(java.lang.String meterId, Field... fields) throws OpenemsError.OpenemsNamedException
Returns the last measurement for the specified meter.See https://api.discovergy.com/docs/ for details.
- Parameters:
meterId
- the Discovergy Meter-IDfields
- the fields to be queried- Returns:
- the Meters as a JsonArray.
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
-