Examples of MBaseDevice


Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

   */
  public MBaseDevice getDevice(String uid, String subId) {
    EList<MBrickd> _mbrickds = getMbrickds();
    for (final MBrickd mbrickd : _mbrickds) {
      {
        final MBaseDevice mDevice = mbrickd.getDevice(uid);
        if (mDevice != null) {
          if (subId == null) {
            return mDevice;
          } else {
            if (mDevice instanceof MSubDeviceHolder) {
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

      String genericId) {
    EList<MSubDevice<?>> genericDevicesList = new BasicEList<MSubDevice<?>>();
    EList<MBrickd> _mbrickds = getMbrickds();
    for (final MBrickd mbrickd : _mbrickds) {
      {
        final MBaseDevice mDevice = mbrickd.getDevice(uid);
        if (mDevice != null) {
          if (mDevice instanceof MSubDeviceHolder) {
            final MSubDeviceHolder<?> mBrick = ((MSubDeviceHolder<?>) mDevice);
            EList<?> _msubdevices = mBrick.getMsubdevices();
            for (final Object mg : _msubdevices)
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.MBASE_DEVICE:
      {
        MBaseDevice mBaseDevice = (MBaseDevice)theEObject;
        T result = caseMBaseDevice(mBaseDevice);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ModelPackage.MDEVICE:
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

          logger.debug("{} Notifier: add many called: ", LoggerConstants.TFINIT);
        } else if (notification.getEventType() == Notification.REMOVE) {
          logger.debug("{} Notifier: remove called: ", LoggerConstants.TFINIT);
          if (notification.getOldValue() instanceof MBaseDevice) {
            logger.debug("{} Notifier: remove called for MBaseDevice", LoggerConstants.TFINIT);
            MBaseDevice mDevice = (MBaseDevice) notification.getOldValue();
            String uid = mDevice.getUid();
            String subId = null;
            if (searchConfiguredItemName(uid, subId) != null) {
              logger.debug("{} Notifier: removing device: uid {} subid {}", LoggerConstants.TFINIT,
                  uid, subId);
              postUpdate(uid, subId, UnDefValue.UNDEF);
            }
          } else {
            logger.debug("{} unknown notification from mdevices {}", LoggerConstants.TFINIT,
                notification);
          }
        }
      } else {
        logger.debug("{} Notifier: unknown feature {}", LoggerConstants.TFINIT,
            notification.getFeature());
      }
    } else if (notification.getNotifier() instanceof MSubDeviceHolder<?>) {
      int featureID = notification.getFeatureID(MSubDeviceHolder.class);
      if (featureID == ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES) {
        logger.debug("{} MSubdevices Notifier called", LoggerConstants.TFINITSUB);
        if (notification.getEventType() == Notification.ADD) {
          MSubDevice<?> mSubDevice = (MSubDevice<?>) notification.getNewValue();
          addMDevice(mSubDevice, mSubDevice.getUid(), mSubDevice.getSubId());

        }
        if (notification.getEventType() == Notification.REMOVE) {
          logger.debug("{} remove notification from subdeviceholder", LoggerConstants.TFINIT);
          logger.debug("{} Notifier: remove called for MSubDevice", LoggerConstants.TFINIT);
          MSubDevice<?> mDevice = (MSubDevice<?>) notification.getOldValue();
          String uid = mDevice.getUid();
          String subId = mDevice.getSubId();
          if (searchConfiguredItemName(uid, subId) != null) {
            logger.debug("{} Notifier: removing device: uid {} subid {}", LoggerConstants.TFINIT,
                uid, subId);
            postUpdate(uid, subId, UnDefValue.UNDEF);
          }
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

    if (deviceName != null) {
      String[] ids = getDeviceIdsForDeviceName(deviceName);
      deviceUid = ids[0];
      deviceSubId = ids[1];
    }
    MBaseDevice mDevice = tinkerforgeEcosystem.getDevice(deviceUid, deviceSubId);
    if (mDevice != null && mDevice.getEnabledA().get()) {
      if (only_poll_enabled && !mDevice.isPoll()) {
        // do nothing
        logger.debug("{} omitting fetch value for no poll{}:{}", LoggerConstants.ITEMUPDATE,
            deviceUid, deviceSubId);
      } else {
        if (mDevice instanceof MSensor) {
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.model.MBaseDevice

            deviceUid = ids[0];
            deviceSubId = ids[1];
          }
          logger.trace("{} found item for command: uid: {}, subid: {}", LoggerConstants.COMMAND,
              deviceUid, deviceSubId);
          MBaseDevice mDevice = tinkerforgeEcosystem.getDevice(deviceUid, deviceSubId);
          if (mDevice != null && mDevice.getEnabledA().get()) {
            if (command instanceof OnOffType) {
              logger.trace("{} found onoff command", LoggerConstants.COMMAND);
              if (mDevice instanceof MInSwitchActor) {
                OnOffType cmd = (OnOffType) command;
                OnOffValue state = cmd == OnOffType.OFF ? OnOffValue.OFF : OnOffValue.ON;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.