diff --git a/pom.xml b/pom.xml index 3ccd667..6afdfc7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.bigboxer23 switchbotapi-java - 1.1.7 + 1.1.8 switchbotapi-java https://github.com/bigboxer23/switchbotapi-java diff --git a/src/main/java/com/bigboxer23/switch_bot/SwitchBotDeviceApi.java b/src/main/java/com/bigboxer23/switch_bot/SwitchBotDeviceApi.java index 3290f42..971e506 100644 --- a/src/main/java/com/bigboxer23/switch_bot/SwitchBotDeviceApi.java +++ b/src/main/java/com/bigboxer23/switch_bot/SwitchBotDeviceApi.java @@ -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 */ - 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); } }