use of org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig in project openhab1-addons by openhab.
the class ProviderItemIterator method iterate.
/**
* Iterate through all providers and their items, creates a converter and
* calls the callback.
*/
public void iterate(HomematicBindingConfig bindingConfig, ProviderItemIteratorCallback callback) {
for (HomematicBindingProvider provider : context.getProviders()) {
List<Item> items = provider.getItemsFor(bindingConfig);
for (Item item : items) {
HomematicBindingConfig providerBindingConfig = provider.getBindingFor(item.getName());
Converter<?> converter = context.getConverterFactory().createConverter(item, providerBindingConfig);
if (converter != null) {
callback.next(providerBindingConfig, item, converter);
}
}
}
}
use of org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig in project openhab1-addons by openhab.
the class StateHolder method loadDatapoints.
/**
* Loads all datapoints from the Homematic server, only executed at startup.
*/
public void loadDatapoints() throws HomematicClientException {
logger.info("Loading Homematic datapoints");
context.getHomematicClient().iterateAllDatapoints(new HmValueItemIteratorCallback() {
@Override
public void iterate(HomematicBindingConfig bindingConfig, HmValueItem hmValueItem) {
datapoints.put(bindingConfig, hmValueItem);
}
});
logger.info("Finished loading {} Homematic datapoints", datapoints.size());
}
use of org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig in project openhab1-addons by openhab.
the class HomematicGenericBindingProvider method processBindingConfiguration.
/**
* {@inheritDoc}
*/
@Override
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException {
super.processBindingConfiguration(context, item, bindingConfig);
HomematicBindingConfig config = parser.parse(item, bindingConfig);
logger.debug("Adding item {} with {}", item.getName(), config.toString());
items.put(item.getName(), item);
addBindingConfig(item, config);
}
use of org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig in project openhab1-addons by openhab.
the class StateHolder method loadVariables.
/**
* Loads all variables from the Homematic server, only executed at startup.
*/
public void loadVariables() throws HomematicClientException {
if (context.getHomematicClient().supportsVariables()) {
logger.info("Loading Homematic Server variables");
context.getHomematicClient().iterateAllVariables(new HmValueItemIteratorCallback() {
@Override
public void iterate(HomematicBindingConfig bindingConfig, HmValueItem variable) {
variables.put(bindingConfig, variable);
}
});
logger.info("Finished loading {} Homematic server variables", variables.size());
}
}
Aggregations