From 099ae8f06d78e741fb17fa9be09fa449eeb9ccf5 Mon Sep 17 00:00:00 2001 From: boehan Date: Thu, 24 Sep 2020 19:52:17 +0200 Subject: [PATCH] fix channel updates (#8563) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hans Böhm --- .../openhab/binding/comfoair/internal/ComfoAirHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.comfoair/src/main/java/org/openhab/binding/comfoair/internal/ComfoAirHandler.java b/bundles/org.openhab.binding.comfoair/src/main/java/org/openhab/binding/comfoair/internal/ComfoAirHandler.java index cfb941a46..1cafc3b82 100644 --- a/bundles/org.openhab.binding.comfoair/src/main/java/org/openhab/binding/comfoair/internal/ComfoAirHandler.java +++ b/bundles/org.openhab.binding.comfoair/src/main/java/org/openhab/binding/comfoair/internal/ComfoAirHandler.java @@ -78,7 +78,8 @@ public class ComfoAirHandler extends BaseThingHandler { if (changeCommand != null) { Set keysToUpdate = getThing().getChannels().stream().map(Channel::getUID).filter(this::isLinked) .map(ChannelUID::getId).collect(Collectors.toSet()); - sendCommand(changeCommand, channelId); + State state = sendCommand(changeCommand, channelId); + updateState(channelUID, state); Collection affectedReadCommands = ComfoAirCommandType .getAffectedReadCommands(channelId, keysToUpdate); @@ -429,7 +430,8 @@ public class ComfoAirHandler extends BaseThingHandler { for (ComfoAirCommandType commandType : commandTypes) { String commandKey = commandType.getKey(); - sendCommand(readCommand, commandKey); + State state = sendCommand(readCommand, commandKey); + updateState(commandKey, state); } } }