Search in sources :

Example 1 with OneWireDevicePropertyStringBindingConfig

use of org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyStringBindingConfig in project openhab1-addons by openhab.

the class OneWireBindingConfigFactory method createOneWireDeviceProperty.

/**
     * @param pvItem
     * @param pvBindingConfig
     * @return a new BindingConfig, corresponding to the given
     *         <code><pvItem/code> and <code><pvBindingConfig/code>
     * @throws BindingConfigParseException
     */
public static OneWireBindingConfig createOneWireDeviceProperty(Item pvItem, String pvBindingConfig) throws BindingConfigParseException {
    logger.debug("createOneWireDeviceProperty: {} - bindingConfig:{}", pvItem.getName(), pvBindingConfig);
    OneWireBindingConfig lvNewBindingConfig = null;
    if (OneWireClearCacheControlBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {
        lvNewBindingConfig = new OneWireClearCacheControlBindingConfig(pvBindingConfig);
    } else if (OneWireDevicePropertyPushButtonBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {
        lvNewBindingConfig = new OneWireDevicePropertyPushButtonBindingConfig(pvBindingConfig);
    } else if (OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig.isBindingConfigToCreate(pvItem, pvBindingConfig)) {
        lvNewBindingConfig = new OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig(pvBindingConfig);
    } else if (pvItem instanceof NumberItem) {
        lvNewBindingConfig = new OneWireDevicePropertyNumberBindingConfig(pvBindingConfig);
    } else if (pvItem instanceof ContactItem) {
        lvNewBindingConfig = new OneWireDevicePropertyContactBindingConfig(pvBindingConfig);
    } else if (pvItem instanceof SwitchItem) {
        lvNewBindingConfig = new OneWireDevicePropertySwitchBindingConfig(pvBindingConfig);
    } else if (pvItem instanceof StringItem) {
        lvNewBindingConfig = new OneWireDevicePropertyStringBindingConfig(pvBindingConfig);
    } else {
        throw new UnsupportedOperationException("the item-type " + pvItem.getClass() + " cannot be a onewire device");
    }
    logger.debug("created newBindingConfig: {}", lvNewBindingConfig.toString());
    return lvNewBindingConfig;
}
Also used : OneWireDevicePropertyPushButtonBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyPushButtonBindingConfig) OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig) OneWireDevicePropertySwitchBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertySwitchBindingConfig) OneWireDevicePropertyStringBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyStringBindingConfig) ContactItem(org.openhab.core.library.items.ContactItem) OneWireClearCacheControlBindingConfig(org.openhab.binding.onewire.internal.control.OneWireClearCacheControlBindingConfig) StringItem(org.openhab.core.library.items.StringItem) OneWireDevicePropertyNumberBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyNumberBindingConfig) NumberItem(org.openhab.core.library.items.NumberItem) OneWireDevicePropertyContactBindingConfig(org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyContactBindingConfig) SwitchItem(org.openhab.core.library.items.SwitchItem)

Aggregations

OneWireClearCacheControlBindingConfig (org.openhab.binding.onewire.internal.control.OneWireClearCacheControlBindingConfig)1 OneWireDevicePropertyContactBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyContactBindingConfig)1 OneWireDevicePropertyNumberBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyNumberBindingConfig)1 OneWireDevicePropertyPushButtonBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyPushButtonBindingConfig)1 OneWireDevicePropertyStringBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertyStringBindingConfig)1 OneWireDevicePropertySwitchBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertySwitchBindingConfig)1 OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig (org.openhab.binding.onewire.internal.deviceproperties.OneWireDevicePropertySwitchMinMaxNumberWarningBindingConfig)1 ContactItem (org.openhab.core.library.items.ContactItem)1 NumberItem (org.openhab.core.library.items.NumberItem)1 StringItem (org.openhab.core.library.items.StringItem)1 SwitchItem (org.openhab.core.library.items.SwitchItem)1