mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[touchwand] Fix thermostat target temperature command (#13427)
* Fix target temperature command 1) Fix target temperature command 2) fixed typo in log * Allow update status even if the unit is not alive Seems 'acwand' status is always "DOWN" so ignore this and just log debug Signed-off-by: Roie Geron <roie.geron@gmail.com>
This commit is contained in:
parent
80804a59b0
commit
96b77ed541
@ -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 "";
|
||||
}
|
||||
|
@ -58,7 +58,15 @@ public class TouchWandThermostatHandler extends TouchWandBaseUnitHandler {
|
||||
if (touchWandBridgeHandler != null) {
|
||||
if (command instanceof OnOffType) {
|
||||
touchWandBridgeHandler.touchWandClient.cmdThermostatOnOff(unitId, (OnOffType) command);
|
||||
} else {
|
||||
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":
|
||||
@ -77,12 +85,10 @@ public class TouchWandThermostatHandler extends TouchWandBaseUnitHandler {
|
||||
touchWandBridgeHandler.touchWandClient.cmdThermostatFanLevel(unitId, "auto");
|
||||
break;
|
||||
default:
|
||||
touchWandBridgeHandler.touchWandClient.cmdThermostatTargetTemperature(unitId, sCommand);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updateThermostatState(TouchWandThermostatUnitData unitData) {
|
||||
String state = unitData.getCurrStatus().getState();
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user