Search in sources :

Example 1 with ZWaveConverterHandler

use of org.openhab.binding.zwave.internal.converter.ZWaveConverterHandler in project openhab1-addons by openhab.

the class ZWaveActiveBinding method initialise.

/**
     * Initialises the binding. This is called after the 'updated' method
     * has been called and all configuration has been passed.
     *
     * @throws ConfigurationException
     */
private void initialise() throws ConfigurationException {
    try {
        logger.debug("Initialising zwave binding");
        this.setProperlyConfigured(true);
        this.deactivate();
        this.zController = new ZWaveController(masterController, isSUC, port, timeout, softReset);
        this.converterHandler = new ZWaveConverterHandler(this.zController, this.eventPublisher);
        zController.addEventListener(this);
        // The network monitor service needs to know the controller...
        this.networkMonitor = new ZWaveNetworkMonitor(this.zController);
        if (healtime != null) {
            this.networkMonitor.setHealTime(healtime);
        }
        if (aliveCheckPeriod != null) {
            this.networkMonitor.setPollPeriod(aliveCheckPeriod);
        }
        if (softReset != false) {
            this.networkMonitor.resetOnError(softReset);
        }
        // The config service needs to know the controller and the network monitor...
        this.zConfigurationService = new ZWaveConfiguration(this.zController, this.networkMonitor);
        zController.addEventListener(this.zConfigurationService);
        return;
    } catch (SerialInterfaceException ex) {
        this.setProperlyConfigured(false);
        throw new ConfigurationException("port", ex.getLocalizedMessage(), ex);
    }
}
Also used : ZWaveConverterHandler(org.openhab.binding.zwave.internal.converter.ZWaveConverterHandler) ConfigurationException(org.osgi.service.cm.ConfigurationException) ZWaveController(org.openhab.binding.zwave.internal.protocol.ZWaveController) ZWaveConfiguration(org.openhab.binding.zwave.internal.config.ZWaveConfiguration) SerialInterfaceException(org.openhab.binding.zwave.internal.protocol.SerialInterfaceException)

Aggregations

ZWaveConfiguration (org.openhab.binding.zwave.internal.config.ZWaveConfiguration)1 ZWaveConverterHandler (org.openhab.binding.zwave.internal.converter.ZWaveConverterHandler)1 SerialInterfaceException (org.openhab.binding.zwave.internal.protocol.SerialInterfaceException)1 ZWaveController (org.openhab.binding.zwave.internal.protocol.ZWaveController)1 ConfigurationException (org.osgi.service.cm.ConfigurationException)1