use of org.teleal.cling.model.action.ActionArgumentValue in project openhab1-addons by openhab.
the class SonosZonePlayer method executeActionInvocation.
protected void executeActionInvocation(ActionInvocation invocation) {
if (invocation != null) {
new ActionCallback.Default(invocation, upnpService.getControlPoint()).run();
ActionException anException = invocation.getFailure();
if (anException != null && anException.getMessage() != null) {
logger.warn(anException.getMessage());
}
Map<String, ActionArgumentValue> result = invocation.getOutputMap();
Map<String, StateVariableValue> mapToProcess = new HashMap<String, StateVariableValue>();
if (result != null) {
// only process the variables that have changed value
for (String variable : result.keySet()) {
ActionArgumentValue newArgument = result.get(variable);
StateVariable newVariable = new StateVariable(variable, new StateVariableTypeDetails(newArgument.getDatatype()));
StateVariableValue newValue = new StateVariableValue(newVariable, newArgument.getValue());
if (isUpdatedValue(variable, newValue)) {
mapToProcess.put(variable, newValue);
}
}
stateMap.putAll(mapToProcess);
sonosBinding.processVariableMap(device, mapToProcess);
}
}
}
Aggregations