Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.bigboxer23</groupId>
<artifactId>switchbotapi-java</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>

<name>switchbotapi-java</name>
<url>https://github.com/bigboxer23/switchbotapi-java</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@ public Device getDeviceStatus(String deviceId) throws IOException {
* href="https://github.com/OpenWonderLabs/SwitchBotAPI#send-device-control-commands">send
* device control commands</a>
*/
public void sendDeviceControlCommands(String deviceId, DeviceCommand command) throws IOException {

public IApiResponse sendDeviceControlCommands(String deviceId, DeviceCommand command) throws IOException {
String stringCommand = provider.getMoshi().adapter(DeviceCommand.class).toJson(command);
try (Response response = OkHttpUtil.postSynchronous(
SwitchBotApi.baseUrl + "v1.1/devices/" + deviceId + "/commands",
RequestBody.create(URLDecoder.decode(stringCommand, StandardCharsets.UTF_8.displayName())
.getBytes(StandardCharsets.UTF_8)),
provider.addAuth())) {
parseResponse(response, DeviceApiResponse.class);
return parseResponse(response, DeviceApiResponse.class);
}
}

Expand Down