gpt4 book ai didi

com.zsmartsystems.zigbee.zcl.clusters.iaszone.ZoneTypeEnum.getByValue()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:46:35 27 4
gpt4 key购买 nike

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

ZoneTypeEnum.getByValue介绍

暂无

代码示例

代码示例来源: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));
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com