当前位置: 首页>>代码示例>>Java>>正文


Java HmDevice.getAddress方法代码示例

本文整理汇总了Java中org.openhab.binding.homematic.internal.model.HmDevice.getAddress方法的典型用法代码示例。如果您正苦于以下问题:Java HmDevice.getAddress方法的具体用法?Java HmDevice.getAddress怎么用?Java HmDevice.getAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openhab.binding.homematic.internal.model.HmDevice的用法示例。


在下文中一共展示了HmDevice.getAddress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterateAllDatapoints

import org.openhab.binding.homematic.internal.model.HmDevice; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void iterateAllDatapoints(HmValueItemIteratorCallback callback) throws HomematicClientException {
	Object[] result = rpcClient.getAllValues(getDefaultInterface());

	try {
		for (int i = 0; i < result.length; i++) {
			@SuppressWarnings("unchecked")
			Map<String, ?> entryMap = (Map<String, ?>) result[i];
			HmDevice device = parseDevice(entryMap);
			addBatteryInfo(device);
			logger.trace("{}", device);

			for (HmChannel channel : device.getChannels()) {
				for (HmDatapoint dp : channel.getDatapoints()) {
					logger.trace("  {}", dp.toDumpString());
					DatapointConfig bindingConfig = new DatapointConfig(device.getAddress(), channel.getNumber(),
							dp.getName());
					callback.iterate(bindingConfig, dp);
				}
			}
		}
	} catch (Exception ex) {
		throw new HomematicClientException(ex.getMessage(), ex);
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:29,代码来源:HomegearClient.java

示例2: iterateAllDatapoints

import org.openhab.binding.homematic.internal.model.HmDevice; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void iterateAllDatapoints(HmValueItemIteratorCallback callback) throws HomematicClientException {
    Object[] result = rpcClient.getAllValues(getDefaultInterface());

    try {
        for (int i = 0; i < result.length; i++) {
            @SuppressWarnings("unchecked")
            Map<String, ?> entryMap = (Map<String, ?>) result[i];
            HmDevice device = parseDevice(entryMap);
            addBatteryInfo(device);
            logger.trace("{}", device);

            for (HmChannel channel : device.getChannels()) {
                for (HmDatapoint dp : channel.getDatapoints()) {
                    logger.trace("  {}", dp.toDumpString());
                    DatapointConfig bindingConfig = new DatapointConfig(device.getAddress(), channel.getNumber(),
                            dp.getName());
                    callback.iterate(bindingConfig, dp);
                }
            }
        }
    } catch (Exception ex) {
        throw new HomematicClientException(ex.getMessage(), ex);
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:29,代码来源:HomegearClient.java

示例3: deviceDiscovered

import org.openhab.binding.homematic.internal.model.HmDevice; //导入方法依赖的package包/类
/**
 * Generates the DiscoveryResult from a Homematic device.
 */
public void deviceDiscovered(HmDevice device) {
    ThingUID bridgeUID = bridgeHandler.getThing().getUID();
    ThingTypeUID typeUid = UidUtils.generateThingTypeUID(device);
    ThingUID thingUID = new ThingUID(typeUid, bridgeUID, device.getAddress());
    String label = device.getName() != null ? device.getName() : device.getAddress();

    DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withBridge(bridgeUID).withLabel(label)
            .build();
    thingDiscovered(discoveryResult);
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:14,代码来源:HomematicDeviceDiscoveryService.java

示例4: generateThingUID

import org.openhab.binding.homematic.internal.model.HmDevice; //导入方法依赖的package包/类
/**
 * Generates the ThingUID for the given device in the given bridge.
 */
public static ThingUID generateThingUID(HmDevice device, Bridge bridge) {
    ThingTypeUID thingTypeUID = generateThingTypeUID(device);
    return new ThingUID(thingTypeUID, bridge.getUID(), device.getAddress());
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:8,代码来源:UidUtils.java


注:本文中的org.openhab.binding.homematic.internal.model.HmDevice.getAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。