Search in sources :

Example 1 with HmValueItemIteratorCallback

use of org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback 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());
}
Also used : HomematicBindingConfig(org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig) HmValueItemIteratorCallback(org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback) HmValueItem(org.openhab.binding.homematic.internal.model.HmValueItem)

Example 2 with HmValueItemIteratorCallback

use of org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback 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());
    }
}
Also used : HomematicBindingConfig(org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig) HmValueItemIteratorCallback(org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback) HmValueItem(org.openhab.binding.homematic.internal.model.HmValueItem)

Aggregations

HmValueItemIteratorCallback (org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback)2 HomematicBindingConfig (org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig)2 HmValueItem (org.openhab.binding.homematic.internal.model.HmValueItem)2