Package org.openhab.binding.zwave.internal.protocol.commandclass

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass


          List<ZWaveDbConfigurationParameter> configList = database.getProductConfigParameters();
          if(configList == null)
            return records;

          // Get the configuration command class for this node
          ZWaveConfigurationCommandClass configurationCommandClass = (ZWaveConfigurationCommandClass) node
              .getCommandClass(CommandClass.CONFIGURATION);

          if (configurationCommandClass == null) {
            logger.error("NODE {}: Error getting configurationCommandClass", nodeId);
            return null;
          }

          // Loop through the parameters and add to the records...
          for (ZWaveDbConfigurationParameter parameter : configList) {
            record = new OpenHABConfigurationRecord(domain, "configuration" + parameter.Index,
                parameter.Index + ": " + database.getLabel(parameter.Label), false);

            ConfigurationParameter configurationParameter = configurationCommandClass
                .getParameter(parameter.Index);

            // Only provide a value if it's stored in the node
            // This is the only way we can be sure of its real value
            if (configurationParameter != null)
View Full Code Here


        // in the domain array
        return;
      }

      if (splitDomain[2].equals("parameters")) {
        ZWaveConfigurationCommandClass configurationCommandClass = (ZWaveConfigurationCommandClass) node
            .getCommandClass(CommandClass.CONFIGURATION);

        if (configurationCommandClass == null) {
          logger.error("NODE {}: Error getting configurationCommandClass in doAction", nodeId);
          return;
        }
        if (action.equals("Refresh")) {
          logger.debug("NODE {}: Refresh parameters", nodeId);

          ZWaveProductDatabase database = new ZWaveProductDatabase();
          if (database.FindProduct(node.getManufacturer(), node.getDeviceType(), node.getDeviceId()) == false) {
            logger.error("NODE {}: Error getting parameters - no database found", nodeId);
            return;
          }

          List<ZWaveDbConfigurationParameter> configList = database.getProductConfigParameters();

          // Request all parameters for this node
          for (ZWaveDbConfigurationParameter parameter : configList)
            this.zController.sendData(configurationCommandClass.getConfigMessage(parameter.Index));
        }
      }

      if (splitDomain[2].equals("wakeup")) {
        if (action.equals("Refresh")) {
View Full Code Here

        // Write the node to disk
        ZWaveNodeSerializer nodeSerializer = new ZWaveNodeSerializer();
        nodeSerializer.SerializeNode(node);
      } else if (splitDomain.length == 4) {
        if (splitDomain[2].equals("parameters")) {
          ZWaveConfigurationCommandClass configurationCommandClass = (ZWaveConfigurationCommandClass) node
              .getCommandClass(CommandClass.CONFIGURATION);

          if (configurationCommandClass == null) {
            logger.error("NODE {}: Error getting configurationCommandClass in doSet", nodeId);
            return;
          }

          int paramIndex = Integer.parseInt(splitDomain[3].substring(13));
          List<ZWaveDbConfigurationParameter> configList = database.getProductConfigParameters();

          // Get the size
          int size = 1;
          for (ZWaveDbConfigurationParameter parameter : configList) {
            if (parameter.Index == paramIndex) {
              size = parameter.Size;
              break;
            }
          }

          logger.debug("Set parameter index '{}' to '{}'", paramIndex, value);

          PendingCfg.Add(ZWaveCommandClass.CommandClass.CONFIGURATION.getKey(), nodeId, paramIndex, Integer.valueOf(value));

          ConfigurationParameter configurationParameter = new ConfigurationParameter(paramIndex,
              Integer.valueOf(value), size);
          // Set the parameter
          this.zController.sendData(configurationCommandClass.setConfigMessage(configurationParameter));
          // And request a read-back
          this.zController.sendData(configurationCommandClass.getConfigMessage(paramIndex));
        }
        if (splitDomain[2].equals("wakeup")) {
          ZWaveWakeUpCommandClass wakeupCommandClass = (ZWaveWakeUpCommandClass) node
              .getCommandClass(CommandClass.WAKE_UP);
View Full Code Here

TOP

Related Classes of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveConfigurationCommandClass

Copyright © 2018 www.massapicom. 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.