From 86b80259c252d0afcfe9b40ce2e9e054a9477c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Mon, 23 Dec 2019 15:04:28 +0100 Subject: [PATCH] implement support for thing actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far only transition time for color channels is supported Signed-off-by: Thomas Weißschuh --- .../action/ZigBeeThingActionParameter.java | 9 +++ .../action/ZigBeeThingActionParameters.java | 9 +++ .../zigbee/action/ZigBeeThingActions.java | 79 +++++++++++++++++++ .../ZigBeeThingActionParameterImpl.java | 40 ++++++++++ .../converter/ZigBeeBaseChannelConverter.java | 7 +- .../zigbee/handler/ZigBeeThingHandler.java | 14 +++- .../converter/ZigBeeConverterColorColor.java | 34 ++++---- .../ZigBeeConverterColorTemperature.java | 7 +- .../converter/ZigBeeConverterDoorLock.java | 3 +- .../converter/ZigBeeConverterFanControl.java | 3 +- .../converter/ZigBeeConverterSwitchLevel.java | 2 +- .../converter/ZigBeeConverterSwitchOnoff.java | 2 +- ...BeeConverterThermostatOccupiedCooling.java | 3 +- ...BeeConverterThermostatOccupiedHeating.java | 3 +- .../ZigBeeConverterThermostatSystemMode.java | 3 +- ...eConverterThermostatUnoccupiedCooling.java | 3 +- ...eConverterThermostatUnoccupiedHeating.java | 3 +- .../ZigBeeConverterWarningDevice.java | 2 +- 18 files changed, 196 insertions(+), 30 deletions(-) create mode 100644 org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameter.java create mode 100644 org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameters.java create mode 100644 org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActions.java create mode 100644 org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/internal/ZigBeeThingActionParameterImpl.java diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameter.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameter.java new file mode 100644 index 000000000..d870837d2 --- /dev/null +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameter.java @@ -0,0 +1,9 @@ +package org.openhab.binding.zigbee.action; + +import java.util.Map; +import java.util.Optional; + +public interface ZigBeeThingActionParameter { + String getName(); + Optional getFromMap(Map params); +} diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameters.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameters.java new file mode 100644 index 000000000..8f6b5f2ce --- /dev/null +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActionParameters.java @@ -0,0 +1,9 @@ +package org.openhab.binding.zigbee.action; + +import org.openhab.binding.zigbee.action.internal.ZigBeeThingActionParameterImpl; + +public final class ZigBeeThingActionParameters { + private ZigBeeThingActionParameters() { } + public static final ZigBeeThingActionParameter TRANSITION_TIME = + new ZigBeeThingActionParameterImpl<>(Integer.class, "transitionTime"); +} diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActions.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActions.java new file mode 100644 index 000000000..23e4d1538 --- /dev/null +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/ZigBeeThingActions.java @@ -0,0 +1,79 @@ +package org.openhab.binding.zigbee.action; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.binding.ThingActions; +import org.eclipse.smarthome.core.thing.binding.ThingActionsScope; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.zigbee.handler.ZigBeeThingHandler; +import org.openhab.core.automation.annotation.ActionInput; +import org.openhab.core.automation.annotation.RuleAction; + +import java.util.HashMap; +import java.util.Map; + +@SuppressWarnings("unused") +@ThingActionsScope(name="zigbee") +@NonNullByDefault +public class ZigBeeThingActions implements ThingActions { + @Nullable + private ZigBeeThingHandler handler; + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + this.handler = (ZigBeeThingHandler) handler; + } + + @Override + @Nullable + public ThingHandler getThingHandler() { + return handler; + } + + @RuleAction(label = "sendCommand") + public void sendCommand( + @ActionInput(name = "channelId", required = true) String channelId, + @ActionInput(name = "command", required = true) Command command, + @ActionInput(name = "params", required = true) Map params + ) { + ChannelUID channel = new ChannelUID(handler.getThing().getUID(), channelId); + handleCommand(channel, command, params); + } + + private void handleCommand(ChannelUID channel, Command command, Map params) { + handler.handleCommand(channel, command, params); + } + + @RuleAction(label = "buildCommand") + public CommandBuilder buildCommand( + @ActionInput(name = "channelId", required = true) String channelId, + @ActionInput(name = "command", required = true) Command command + ) { + ChannelUID channel = new ChannelUID(handler.getThing().getUID(), channelId); + return new CommandBuilder(this, channel, command); + } + + public static class CommandBuilder { + private final ZigBeeThingActions actions; + private final ChannelUID channel; + private final Command command; + private final Map params = new HashMap<>(); + + private CommandBuilder(ZigBeeThingActions actions, ChannelUID channel, Command command) { + this.actions = actions; + this.channel = channel; + this.command = command; + } + + public CommandBuilder with(ZigBeeThingActionParameter parameter, T value) { + params.put(parameter.getName(), value); + return this; + } + + public void send() { + actions.handleCommand(channel, command, params); + } + } +} diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/internal/ZigBeeThingActionParameterImpl.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/internal/ZigBeeThingActionParameterImpl.java new file mode 100644 index 000000000..9a5e40721 --- /dev/null +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/action/internal/ZigBeeThingActionParameterImpl.java @@ -0,0 +1,40 @@ +package org.openhab.binding.zigbee.action.internal; + +import org.openhab.binding.zigbee.action.ZigBeeThingActionParameter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; +import java.util.Optional; + +public final class ZigBeeThingActionParameterImpl implements ZigBeeThingActionParameter { + private final Logger logger = LoggerFactory.getLogger(ZigBeeThingActionParameterImpl.class); + + private final String name; + private final Class klazz; + + public ZigBeeThingActionParameterImpl(Class klazz, String name) { + this.klazz = klazz; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public Optional getFromMap(Map params) { + Object param = params.get(getName()); + if (param == null) { + return Optional.empty(); + } else if (!klazz.isInstance(param)) { + logger.debug("Can not retrieve param {}: object of type {} ({}) can not be casted to {}", + getName(), param.getClass(), (param), klazz.getName() + ); + return Optional.empty(); + } else { + return Optional.of(klazz.cast(param)); + } + } +} diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/converter/ZigBeeBaseChannelConverter.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/converter/ZigBeeBaseChannelConverter.java index aa8b62cfa..459267261 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/converter/ZigBeeBaseChannelConverter.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/converter/ZigBeeBaseChannelConverter.java @@ -14,6 +14,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -251,10 +252,14 @@ public void handleRefresh() { * * @param command the {@link Command} to send */ - public void handleCommand(final Command command) { + public void handleCommand(final Command command, final Map params) { // Overridable if a channel can be commanded } + public final void handleCommand(final Command command) { + handleCommand(command, Collections.emptyMap()); + } + /** * Creates a {@link Channel} if this converter supports features from the {@link ZigBeeEndpoint} * If the converter doesn't support any features, it returns null. diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/handler/ZigBeeThingHandler.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/handler/ZigBeeThingHandler.java index bf7768c59..ef2789f67 100755 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/handler/ZigBeeThingHandler.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/handler/ZigBeeThingHandler.java @@ -48,6 +48,7 @@ import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.ThingStatusInfo; import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; import org.eclipse.smarthome.core.thing.binding.firmware.Firmware; import org.eclipse.smarthome.core.thing.binding.firmware.FirmwareUpdateHandler; @@ -64,6 +65,7 @@ import org.openhab.binding.zigbee.discovery.ZigBeeNodePropertyDiscoverer; import org.openhab.binding.zigbee.internal.ZigBeeConfigDescriptionParameters; import org.openhab.binding.zigbee.internal.ZigBeeDeviceConfigHandler; +import org.openhab.binding.zigbee.action.ZigBeeThingActions; import org.openhab.binding.zigbee.internal.converter.config.ZclClusterConfigFactory; import org.openhab.binding.zigbee.internal.converter.config.ZclClusterConfigHandler; import org.openhab.binding.zigbee.internal.converter.config.ZclReportingConfig; @@ -692,8 +694,13 @@ public void handleConfigurationUpdate(Map configurationParameter } } + @Override public void handleCommand(final ChannelUID channelUID, final Command command) { + handleCommand(channelUID, command, Collections.emptyMap()); + } + + public void handleCommand(final ChannelUID channelUID, final Command command, final Map params) { logger.debug("{}: Command for channel {} --> {} [{}]", nodeIeeeAddress, channelUID, command, command.getClass().getSimpleName()); @@ -718,7 +725,7 @@ public void run() { if (command == RefreshType.REFRESH) { handler.handleRefresh(); } else { - handler.handleCommand(command); + handler.handleCommand(command, params); } } catch (Exception e) { logger.debug("{}: Exception sending command to channel {}", nodeIeeeAddress, channelUID, e); @@ -1006,4 +1013,9 @@ public boolean isUpdateExecutable() { // Always allow the firmware to be updated return true; } + + @Override + public Collection> getServices() { + return Collections.singleton(ZigBeeThingActions.class); + } } diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorColor.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorColor.java index d5617621c..721653eba 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorColor.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorColor.java @@ -34,6 +34,7 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.zigbee.ZigBeeBindingConstants; +import org.openhab.binding.zigbee.action.ZigBeeThingActionParameters; import org.openhab.binding.zigbee.converter.ZigBeeBaseChannelConverter; import org.openhab.binding.zigbee.internal.converter.config.ZclLevelControlConfig; import org.slf4j.Logger; @@ -274,14 +275,14 @@ public void handleRefresh() { clusterColorControl.getColorMode(0); } - private void changeOnOff(OnOffType onoff) throws InterruptedException, ExecutionException { + private void changeOnOff(OnOffType onoff, int transitionTime) throws InterruptedException, ExecutionException { boolean on = onoff == OnOffType.ON; if (clusterOnOff == null) { if (clusterLevelControl == null) { logger.warn("{}: ignoring on/off command", endpoint.getIeeeAddress()); } else { - changeBrightness(on ? PercentType.HUNDRED : PercentType.ZERO); + changeBrightness(on ? PercentType.HUNDRED : PercentType.ZERO, transitionTime); } return; } @@ -293,12 +294,12 @@ private void changeOnOff(OnOffType onoff) throws InterruptedException, Execution } } - private void changeBrightness(PercentType brightness) throws InterruptedException, ExecutionException { + private void changeBrightness(PercentType brightness, int transitionTime) throws InterruptedException, ExecutionException { if (clusterLevelControl == null) { if (clusterOnOff == null) { logger.warn("{}: ignoring brightness command", endpoint.getIeeeAddress()); } else { - changeOnOff(brightness.intValue() == 0 ? OnOffType.OFF : OnOffType.ON); + changeOnOff(brightness.intValue() == 0 ? OnOffType.OFF : OnOffType.ON, transitionTime); } return; } @@ -309,23 +310,23 @@ private void changeBrightness(PercentType brightness) throws InterruptedExceptio if (brightness.equals(PercentType.ZERO)) { clusterOnOff.offCommand(); } else { - clusterLevelControl.moveToLevelWithOnOffCommand(level, configLevelControl.getDefaultTransitionTime()) + clusterLevelControl.moveToLevelWithOnOffCommand(level, transitionTime) .get(); } } else { - clusterLevelControl.moveToLevelCommand(level, configLevelControl.getDefaultTransitionTime()).get(); + clusterLevelControl.moveToLevelCommand(level, transitionTime).get(); } } - private void changeColorHueSaturation(HSBType color) throws InterruptedException, ExecutionException { + private void changeColorHueSaturation(HSBType color, int transitionTime) throws InterruptedException, ExecutionException { int hue = (int) (color.getHue().floatValue() * 254.0f / 360.0f + 0.5f); int saturation = percentToLevel(color.getSaturation()); clusterColorControl - .moveToHueAndSaturationCommand(hue, saturation, configLevelControl.getDefaultTransitionTime()).get(); + .moveToHueAndSaturationCommand(hue, saturation, transitionTime).get(); } - private void changeColorXY(HSBType color) throws InterruptedException, ExecutionException { + private void changeColorXY(HSBType color, int transitionTime) throws InterruptedException, ExecutionException { PercentType xy[] = color.toXY(); logger.debug("{}: Change Color HSV ({}, {}, {}) -> XY ({}, {})", endpoint.getIeeeAddress(), color.getHue(), @@ -333,31 +334,32 @@ private void changeColorXY(HSBType color) throws InterruptedException, Execution int x = (int) (xy[0].floatValue() / 100.0f * 65536.0f + 0.5f); // up to 65279 int y = (int) (xy[1].floatValue() / 100.0f * 65536.0f + 0.5f); // up to 65279 - clusterColorControl.moveToColorCommand(x, y, configLevelControl.getDefaultTransitionTime()).get(); + clusterColorControl.moveToColorCommand(x, y, transitionTime).get(); } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, final Map params) { + int transitionTime = ZigBeeThingActionParameters.TRANSITION_TIME.getFromMap(params).orElseGet(configLevelControl::getDefaultTransitionTime); try { if (command instanceof HSBType) { HSBType color = (HSBType) command; PercentType brightness = color.getBrightness(); - changeBrightness(brightness); + changeBrightness(brightness, transitionTime); if (delayedColorChange && brightness.intValue() != lastHSB.getBrightness().intValue()) { Thread.sleep(1100); } if (supportsHue) { - changeColorHueSaturation(color); + changeColorHueSaturation(color, transitionTime); } else { - changeColorXY(color); + changeColorXY(color, transitionTime); } } else if (command instanceof PercentType) { - changeBrightness((PercentType) command); + changeBrightness((PercentType) command, transitionTime); } else if (command instanceof OnOffType) { - changeOnOff((OnOffType) command); + changeOnOff((OnOffType) command, transitionTime); } } catch (InterruptedException | ExecutionException e) { logger.warn("{}: Exception processing command", endpoint.getIeeeAddress(), e); diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorTemperature.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorTemperature.java index 91078ab69..5d52ba029 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorTemperature.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterColorTemperature.java @@ -14,6 +14,7 @@ import static com.zsmartsystems.zigbee.zcl.clusters.ZclColorControlCluster.ATTR_COLORTEMPERATURE; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.library.types.OnOffType; @@ -24,6 +25,7 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.zigbee.ZigBeeBindingConstants; +import org.openhab.binding.zigbee.action.ZigBeeThingActionParameters; import org.openhab.binding.zigbee.converter.ZigBeeBaseChannelConverter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -119,7 +121,8 @@ public void handleRefresh() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, final Map params) { + int transitionTime = ZigBeeThingActionParameters.TRANSITION_TIME.getFromMap(params).orElse(10); PercentType colorTemperaturePercentage = PercentType.ZERO; if (command instanceof PercentType) { colorTemperaturePercentage = (PercentType) command; @@ -128,7 +131,7 @@ public void handleCommand(final Command command) { return; } - clusterColorControl.moveToColorTemperatureCommand(percentToMired(colorTemperaturePercentage), 10); + clusterColorControl.moveToColorTemperatureCommand(percentToMired(colorTemperaturePercentage), transitionTime); } @Override diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterDoorLock.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterDoorLock.java index 5d0d5f0b0..df60a0216 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterDoorLock.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterDoorLock.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.library.types.OnOffType; @@ -95,7 +96,7 @@ public void handleRefresh() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, final Map params) { if (command == OnOffType.ON) { cluster.lockDoorCommand(new ByteArray(new byte[0])); } else { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterFanControl.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterFanControl.java index 715f1708a..4fe803ec6 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterFanControl.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterFanControl.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.library.types.DecimalType; @@ -106,7 +107,7 @@ public void handleRefresh() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { int value; if (command instanceof OnOffType) { value = command == OnOffType.ON ? MODE_ON : MODE_OFF; diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchLevel.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchLevel.java index 112ba3df1..fc17ae991 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchLevel.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchLevel.java @@ -331,7 +331,7 @@ public void handleRefresh() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, final Map params) { if (command instanceof OnOffType) { handleOnOffCommand((OnOffType) command); } else if (command instanceof PercentType) { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchOnoff.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchOnoff.java index abd6bdbe9..83f74b594 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchOnoff.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterSwitchOnoff.java @@ -194,7 +194,7 @@ public void handleRefresh() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { if (clusterOnOffServer == null) { logger.warn("{}: OnOff converter is not linked to a server and cannot accept commands", endpoint.getIeeeAddress()); diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedCooling.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedCooling.java index 3e0c37e45..32f2ae0fa 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedCooling.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedCooling.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.thing.Channel; @@ -99,7 +100,7 @@ public void disposeConverter() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { Integer value = temperatureToValue(command); if (value == null) { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedHeating.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedHeating.java index ef860f0ee..9405e96f7 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedHeating.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatOccupiedHeating.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.thing.Channel; @@ -95,7 +96,7 @@ public void disposeConverter() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { Integer value = temperatureToValue(command); if (value == null) { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatSystemMode.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatSystemMode.java index 84ead8e99..ad3b0e6af 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatSystemMode.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatSystemMode.java @@ -15,6 +15,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.library.types.DecimalType; @@ -107,7 +108,7 @@ public void disposeConverter() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { Integer value = null; if (command instanceof OnOffType) { // OnOff switches between OFF=OFF and ON=AUTO diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedCooling.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedCooling.java index daecda6b9..166db4c1e 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedCooling.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedCooling.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.thing.Channel; @@ -96,7 +97,7 @@ public void disposeConverter() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { Integer value = temperatureToValue(command); if (value == null) { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedHeating.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedHeating.java index c86534a5e..26b99f0db 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedHeating.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/ZigBeeConverterThermostatUnoccupiedHeating.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.zigbee.internal.converter; +import java.util.Map; import java.util.concurrent.ExecutionException; import org.eclipse.smarthome.core.thing.Channel; @@ -98,7 +99,7 @@ public void disposeConverter() { } @Override - public void handleCommand(final Command command) { + public void handleCommand(final Command command, Map params) { Integer value = temperatureToValue(command); if (value == null) { diff --git a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/warningdevice/ZigBeeConverterWarningDevice.java b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/warningdevice/ZigBeeConverterWarningDevice.java index 79d76054e..480c9a6c8 100644 --- a/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/warningdevice/ZigBeeConverterWarningDevice.java +++ b/org.openhab.binding.zigbee/src/main/java/org/openhab/binding/zigbee/internal/converter/warningdevice/ZigBeeConverterWarningDevice.java @@ -113,7 +113,7 @@ private void updateConfigParameter(Configuration currentConfiguration, Entry params) { if (iasWdCluster == null) { logger.warn("{}: Warning device converter is not linked to a server and cannot accept commands", endpoint.getIeeeAddress());