com.zsmartsystems.zigbee.zcl.clusters.iaszone.ZoneTypeEnum类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.zsmartsystems.zigbee.zcl.clusters.iaszone.ZoneTypeEnum类的一些代码示例,展示了ZoneTypeEnum类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneTypeEnum类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.clusters.iaszone.ZoneTypeEnum
类名称:ZoneTypeEnum

ZoneTypeEnum介绍

[英]Enumeration of IAS Zone attribute ZoneType options.

Code is auto-generated. Modifications may be overwritten!
[中]IAS区域属性ZoneType选项的枚举。
代码是自动生成的。修改可能会被覆盖!

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Gets the IAS zone type for this device. This is provided by the remote device during enrollment.
 *
 * @return the IAS zone type as {@link ZoneTypeEnum}
 */
public ZoneTypeEnum getZoneType() {
  return ZoneTypeEnum.getByValue(zoneType);
}

代码示例来源:origin: openhab/org.openhab.binding.zigbee

protected boolean supportsIasChannel(ZigBeeEndpoint endpoint, ZoneTypeEnum requiredZoneType) {
  if (!hasIasZoneInputCluster(endpoint)) {
    return false;
  }
  ZclIasZoneCluster cluster = (ZclIasZoneCluster) endpoint.getInputCluster(ZclIasZoneCluster.CLUSTER_ID);
  Integer zoneTypeId = null;
  for (int retry = 0; retry < 3; retry++) {
    zoneTypeId = cluster.getZoneType(Long.MAX_VALUE);
    if (zoneTypeId != null) {
      break;
    }
  }
  if (zoneTypeId == null) {
    logger.debug("{}: Did not get IAS zone type", endpoint.getIeeeAddress());
    return false;
  }
  ZoneTypeEnum zoneType = ZoneTypeEnum.getByValue(zoneTypeId);
  logger.debug("{}: IAS zone type {}", endpoint.getIeeeAddress(), zoneType);
  return zoneType == requiredZoneType;
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

private void initialise() {
  Integer currentState = iasZoneCluster.getZoneState(0);
  if (currentState != null) {
    ZoneStateEnum currentStateEnum = ZoneStateEnum.getByValue(currentState);
    logger.debug("{}: IAS CIE state is currently {}[{}]", iasZoneCluster.getZigBeeAddress(), currentStateEnum,
        currentState);
  }
  IeeeAddress currentIeeeAddress = iasZoneCluster.getIascieAddress(0);
  logger.debug("{}: IAS CIE address is currently {}", iasZoneCluster.getZigBeeAddress(), currentIeeeAddress);
  if (!ieeeAddress.equals(currentIeeeAddress)) {
    // Set the CIE address in the remote device. This is where the device will send its reports.
    iasZoneCluster.setIascieAddress(ieeeAddress);
    currentIeeeAddress = iasZoneCluster.getIascieAddress(0);
    logger.debug("{}: IAS CIE address is confirmed {}", iasZoneCluster.getZigBeeAddress(), currentIeeeAddress);
  }
  Integer currentZone = iasZoneCluster.getZoneId(0);
  if (currentZone == null) {
    logger.debug("{}: IAS CIE zone ID request failed", iasZoneCluster.getZigBeeAddress());
  } else {
    logger.debug("{}: IAS CIE zone ID is currently {}", iasZoneCluster.getZigBeeAddress(), currentZone);
  }
  Integer zoneType = iasZoneCluster.getZoneType(Long.MAX_VALUE);
  if (zoneType == null) {
    logger.debug("{}: IAS CIE zone type request failed", iasZoneCluster.getZigBeeAddress());
  } else {
    logger.debug("{}: IAS CIE zone type is 0x{}, {}", iasZoneCluster.getZigBeeAddress(),
        String.format("%04X", zoneType), ZoneTypeEnum.getByValue(zoneType));
  }
}

相关文章