/** {@inheritDoc} */ @Override public SerialMessage executeRefresh( ZWaveNode node, ZWaveBinarySwitchCommandClass commandClass, int endpointId, Map<String, String> arguments) { logger.debug( "NODE {}: Generating poll message for {}, endpoint {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); return node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId); }
/** {@inheritDoc} */ @Override public void receiveCommand( Item item, Command command, ZWaveNode node, ZWaveBinarySwitchCommandClass commandClass, int endpointId, Map<String, String> arguments) { ZWaveCommandConverter<?, ?> converter = this.getCommandConverter(command.getClass()); if (converter == null) { logger.warn( "NODE {}: No converter found for item = {}, endpoint = {}, ignoring command.", node.getNodeId(), item.getName(), endpointId); return; } SerialMessage serialMessage = node.encapsulate( commandClass.setValueMessage( (Integer) converter.convertFromCommandToValue(item, command)), commandClass, endpointId); if (serialMessage == null) { logger.warn( "NODE {}: Generating message failed for command class = {}, endpoint = {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); return; } this.getController().sendData(serialMessage); if (command instanceof State) { this.getEventPublisher().postUpdate(item.getName(), (State) command); } }