@Override
protected void internalReceiveCommand(String itemName,
Command command) {
PlugwiseBindingProvider provider = findFirstMatchingBindingProvider(itemName);
String commandAsString = command.toString();
if(command != null){
List<Command> commands = new ArrayList<Command>();
// check if the command is valid for this item by checking if a pw ID exists
String checkID = provider.getPlugwiseID(itemName,command);
if(checkID != null) {
commands.add(command);
} else {
// ooops - command is not defined, but maybe we have something of the same Type (e.g Decimal, String types)
//commands = provider.getCommandsByType(itemName, command.getClass());
commands = provider.getAllCommands(itemName);
}
for(Command someCommand : commands) {
String plugwiseID = provider.getPlugwiseID(itemName,someCommand);
PlugwiseCommandType plugwiseCommandType = provider.getPlugwiseCommandType(itemName,someCommand);
if(plugwiseID != null) {
if(plugwiseCommandType != null){
@SuppressWarnings("unused")
boolean result = executeCommand(plugwiseID,plugwiseCommandType,commandAsString);