Package io.openems.edge.io.shelly.common
Class ShellyApi
java.lang.Object
io.openems.edge.io.shelly.common.ShellyApi
Implements the local Shelly REST Api.
See https://shelly-api-docs.shelly.cloud
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getRelayIson
(int index) Gets the "ison" state of the relay with the given index.com.google.gson.JsonObject
Gets the status of the device.void
setRelayTurn
(int index, boolean value) Turns the relay with the given index on or off.
-
Constructor Details
-
ShellyApi
-
-
Method Details
-
getStatus
Gets the status of the device.See https://shelly-api-docs.shelly.cloud/#shelly2-5-status
- Returns:
- the status as JsonObject according to Shelly docs
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getRelayIson
Gets the "ison" state of the relay with the given index.See https://shelly-api-docs.shelly.cloud/#shelly2-5-relay-index
- Parameters:
index
- the index of the relay- Returns:
- the boolean value
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
setRelayTurn
Turns the relay with the given index on or off.- Parameters:
index
- the index of the relayvalue
- true to turn on; false to turn off- Throws:
OpenemsError.OpenemsNamedException
- on error
-