use of org.openhab.binding.homematic.internal.model.HmVariable in project openhab1-addons by openhab.
the class ConverterTest method getValueListVariable.
private HmVariable getValueListVariable(Object value, String valueList) throws Exception {
HmVariable var = new HmVariable();
FieldUtils.writeField(var, "name", "Var", true);
FieldUtils.writeField(var, "valueType", 16, true);
FieldUtils.writeField(var, "subType", 29, true);
Object convertedValueList = new ValueListAdapter().unmarshal(valueList == null ? null : valueList.toString());
FieldUtils.writeField(var, "valueList", convertedValueList, true);
var.setValue(value);
return var;
}
use of org.openhab.binding.homematic.internal.model.HmVariable in project openhab1-addons by openhab.
the class HomegearClient method createVariable.
/**
* Creates a writeable HmVariable object.
*/
private HmVariable createVariable(String name, Object value) {
HmVariable var = new HmVariable();
var.setName(name);
var.setWriteable(true);
var.setValueType(guessType(value));
var.setValue(value);
return var;
}
use of org.openhab.binding.homematic.internal.model.HmVariable in project openhab1-addons by openhab.
the class CcuClient method iterateAllVariables.
/**
* {@inheritDoc}
*/
@Override
public void iterateAllVariables(HmValueItemIteratorCallback callback) throws HomematicClientException {
List<HmVariable> variables = sendScriptByName("getAllVariables", HmVariableList.class).getVariables();
for (HmVariable variable : variables) {
VariableConfig bindingConfig = new VariableConfig(variable.getName());
callback.iterate(bindingConfig, variable);
}
}
use of org.openhab.binding.homematic.internal.model.HmVariable in project openhab1-addons by openhab.
the class HomegearClient method iterateAllVariables.
/**
* {@inheritDoc}
*/
@Override
public void iterateAllVariables(HmValueItemIteratorCallback callback) throws HomematicClientException {
Map<String, ?> result = rpcClient.getAllSystemVariables(getDefaultInterface());
for (String variableName : result.keySet()) {
HmVariable variable = createVariable(variableName, result.get(variableName));
VariableConfig bindingConfig = new VariableConfig(variable.getName());
callback.iterate(bindingConfig, variable);
}
}
Aggregations