本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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());
}