當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。