Search in sources :

Example 6 with HmValueItem

use of org.openhab.binding.homematic.internal.model.HmValueItem 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

HmValueItem (org.openhab.binding.homematic.internal.model.HmValueItem)6 HomematicBindingConfig (org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig)3 HmValueItemIteratorCallback (org.openhab.binding.homematic.internal.communicator.client.BaseHomematicClient.HmValueItemIteratorCallback)2 ActionConfig (org.openhab.binding.homematic.internal.config.binding.ActionConfig)2 ProgramConfig (org.openhab.binding.homematic.internal.config.binding.ProgramConfig)2 State (org.openhab.core.types.State)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ProviderItemIteratorCallback (org.openhab.binding.homematic.internal.communicator.ProviderItemIterator.ProviderItemIteratorCallback)1 DatapointConfig (org.openhab.binding.homematic.internal.config.binding.DatapointConfig)1 HmDatapoint (org.openhab.binding.homematic.internal.model.HmDatapoint)1 Item (org.openhab.core.items.Item)1