Package io.openems.edge.evcs.dezony
Class DezonyApi
java.lang.Object
io.openems.edge.evcs.dezony.DezonyApi
Implements the dezony REST-Api.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Sends a GET Request to lock charging.com.google.gson.JsonElement
Sends a GET Request to unlock charging.com.google.gson.JsonElement
Sends a GET Request to read the last metrics.com.google.gson.JsonElement
getState()
Sends a GET Request to read the State.com.google.gson.JsonElement
sendGetRequest
(String endpoint) Sends a get request.com.google.gson.JsonObject
sendPostRequest
(String endpoint) Sends a post request to the dezony.setCurrent
(int current) Sends a POST Request to set the charging current.
-
Constructor Details
-
DezonyApi
-
-
Method Details
-
getState
Sends a GET Request to read the State.- Returns:
- result or null
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getLastMetrics
Sends a GET Request to read the last metrics.- Returns:
- result or null
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
enableCharging
Sends a GET Request to unlock charging.- Returns:
- result or null
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
disableCharging
Sends a GET Request to lock charging.- Returns:
- true if `charging_is_locked`; false otherwise
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
setCurrent
Sends a POST Request to set the charging current.- Parameters:
current
- the new charging current in [mA]- Returns:
- response charging_current
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
sendGetRequest
public com.google.gson.JsonElement sendGetRequest(String endpoint) throws OpenemsError.OpenemsNamedException Sends a get request.- Parameters:
endpoint
- the REST Api endpoint- Returns:
- a JsonObject or JsonArray
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
sendPostRequest
public com.google.gson.JsonObject sendPostRequest(String endpoint) throws OpenemsError.OpenemsNamedException Sends a post request to the dezony.- Parameters:
endpoint
- the REST Api endpoint @return a JsonObject or JsonArray @throws OpenemsNamedException on error @throws- Returns:
- A JsonObject
- Throws:
OpenemsError.OpenemsNamedException
- on error
-