Search in sources :

Example 1 with DmxBindingProvider

use of org.openhab.binding.dmx.DmxBindingProvider in project openhab1-addons by openhab.

the class DmxBinding method receiveCommand.

/**
     * {@inheritDoc}
     */
@Override
public void receiveCommand(String itemName, Command command) {
    if (dmxService == null) {
        logger.warn("No DMX Service available.");
        return;
    }
    // get the item's corresponding dmx binding
    DmxItem itemBinding = null;
    for (DmxBindingProvider provider : providers) {
        if (provider.providesBindingFor(itemName)) {
            itemBinding = provider.getBindingConfig(itemName);
            break;
        }
    }
    if (itemBinding == null) {
        return;
    }
    dmxService.suspend(true);
    itemBinding.processCommand(dmxService, command);
    dmxService.suspend(false);
}
Also used : DmxBindingProvider(org.openhab.binding.dmx.DmxBindingProvider) DmxItem(org.openhab.binding.dmx.internal.config.DmxItem)

Aggregations

DmxBindingProvider (org.openhab.binding.dmx.DmxBindingProvider)1 DmxItem (org.openhab.binding.dmx.internal.config.DmxItem)1