diff --git a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandRestClient.java b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandRestClient.java index c9281e3a2..513dcb394 100644 --- a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandRestClient.java +++ b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandRestClient.java @@ -230,7 +230,7 @@ public class TouchWandRestClient { response = request.send(); return response.getContentAsString(); } catch (InterruptedException | TimeoutException | ExecutionException e) { - logger.warn("Error opening connecton to {} : {} ", touchWandIpAddr, e.getMessage()); + logger.warn("Error opening connection to {} : {} ", touchWandIpAddr, e.getMessage()); } return ""; } diff --git a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandThermostatHandler.java b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandThermostatHandler.java index 81d2ca756..f5a686005 100644 --- a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandThermostatHandler.java +++ b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandThermostatHandler.java @@ -58,28 +58,34 @@ public class TouchWandThermostatHandler extends TouchWandBaseUnitHandler { if (touchWandBridgeHandler != null) { if (command instanceof OnOffType) { touchWandBridgeHandler.touchWandClient.cmdThermostatOnOff(unitId, (OnOffType) command); - } else { - String sCommand = command.toString(); - switch (sCommand) { - case "cool": - case "heat": - case "fan": - case "auto": - case "dry": - touchWandBridgeHandler.touchWandClient.cmdThermostatMode(unitId, sCommand); - break; - case "low": - case "medium": - case "high": - touchWandBridgeHandler.touchWandClient.cmdThermostatFanLevel(unitId, sCommand); - break; - case "fanAuto": - touchWandBridgeHandler.touchWandClient.cmdThermostatFanLevel(unitId, "auto"); - break; - default: - touchWandBridgeHandler.touchWandClient.cmdThermostatTargetTemperature(unitId, sCommand); - break; - } + return; + } + if (command instanceof QuantityType) { + final QuantityType value = ((QuantityType) command).toUnit(SIUnits.CELSIUS); + String targetTemperature = String.valueOf(value.intValue()); + touchWandBridgeHandler.touchWandClient.cmdThermostatTargetTemperature(unitId, targetTemperature); + return; + } + + String sCommand = command.toString(); + switch (sCommand) { + case "cool": + case "heat": + case "fan": + case "auto": + case "dry": + touchWandBridgeHandler.touchWandClient.cmdThermostatMode(unitId, sCommand); + break; + case "low": + case "medium": + case "high": + touchWandBridgeHandler.touchWandClient.cmdThermostatFanLevel(unitId, sCommand); + break; + case "fanAuto": + touchWandBridgeHandler.touchWandClient.cmdThermostatFanLevel(unitId, "auto"); + break; + default: + break; } } } diff --git a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java index 24dbd8f23..97a4241ba 100644 --- a/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java +++ b/bundles/org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal/TouchWandWebSockets.java @@ -156,7 +156,7 @@ public class TouchWandWebSockets { } touchWandUnit = TouchWandUnitFromJson.parseResponse(unitObj.get("unit").getAsJsonObject()); if (!touchWandUnit.getStatus().equals("ALIVE")) { - return; + logger.debug("UNIT_CHANGED unit status not ALIVE : {}", touchWandUnit.getStatus()); } boolean supportedUnitType = Arrays.asList(SUPPORTED_TOUCHWAND_TYPES).contains(touchWandUnit.getType()); if (!supportedUnitType) {