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 "";
}
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;
}
}
}
}
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) {