Search in sources :

Example 1 with TellstickBindingProvider

use of org.openhab.binding.tellstick.TellstickBindingProvider in project openhab1-addons by openhab.

the class TellstickBinding method registerListeners.

private void registerListeners() {
    for (TellstickBindingProvider prov : providers) {
        prov.addListener(new TellstickDeviceEventHandler());
        prov.addListener(new TellstickSensorEventHandler());
    }
}
Also used : TellstickBindingProvider(org.openhab.binding.tellstick.TellstickBindingProvider)

Example 2 with TellstickBindingProvider

use of org.openhab.binding.tellstick.TellstickBindingProvider in project openhab1-addons by openhab.

the class TellstickBinding method refreshFromTellstick.

private void refreshFromTellstick() {
    logger.trace("Update with telldus state");
    for (TellstickBindingProvider prov : providers) {
        for (String name : prov.getItemNames()) {
            TellstickDevice dev = prov.getDevice(name);
            if (dev != null) {
                Method method = Method.getMethodById(dev.getStatus());
                sendToOpenHab(name, resolveCommand(method, dev.getData()));
            }
        }
    }
    lastRefresh = System.currentTimeMillis();
}
Also used : TellstickDevice(org.openhab.binding.tellstick.internal.device.TellstickDevice) Method(org.openhab.binding.tellstick.internal.JNA.Method) TellstickBindingProvider(org.openhab.binding.tellstick.TellstickBindingProvider)

Aggregations

TellstickBindingProvider (org.openhab.binding.tellstick.TellstickBindingProvider)2 Method (org.openhab.binding.tellstick.internal.JNA.Method)1 TellstickDevice (org.openhab.binding.tellstick.internal.device.TellstickDevice)1