本文整理汇总了Java中org.jupnp.model.meta.DeviceDetails类的典型用法代码示例。如果您正苦于以下问题:Java DeviceDetails类的具体用法?Java DeviceDetails怎么用?Java DeviceDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeviceDetails类属于org.jupnp.model.meta包,在下文中一共展示了DeviceDetails类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getThingUID
import org.jupnp.model.meta.DeviceDetails; //导入依赖的package包/类
@Override
public ThingUID getThingUID(RemoteDevice device) {
DeviceDetails details = device.getDetails();
if (details != null) {
ModelDetails modelDetails = details.getModelDetails();
ManufacturerDetails modelManufacturerDetails = details.getManufacturerDetails();
if (modelDetails != null && modelManufacturerDetails != null) {
String modelName = modelDetails.getModelName();
String modelManufacturer = modelManufacturerDetails.getManufacturer();
if (modelName != null && modelManufacturer != null) {
if (modelManufacturer.equals("Denon")) {
if (modelName.startsWith("HEOS") || modelName.endsWith("H")) {
if (device.getType().getType().startsWith("ACT")) {
return new ThingUID(THING_TYPE_BRIDGE,
device.getIdentity().getUdn().getIdentifierString());
}
}
}
}
}
}
return null;
}
示例2: createResult
import org.jupnp.model.meta.DeviceDetails; //导入依赖的package包/类
@Override
public DiscoveryResult createResult(RemoteDevice device) {
ThingUID uid = getThingUID(device);
if (uid != null) {
Map<String, Object> properties = new HashMap<>(2);
// After correct Thing UID is created, we have confidence that all following parameters exist and we don't
// need to check for null objects here in the device details
DeviceDetails details = device.getDetails();
String serial = details.getSerialNumber();
String host = details.getPresentationURI().getHost();
String label = details.getFriendlyName() + " @ " + host;
int port = details.getPresentationURI().getPort();
String vendor = details.getManufacturerDetails().getManufacturer();
String model = details.getModelDetails().getModelName();
logger.debug("Creating discovery result for serial {} label {} port {}", serial, label, port);
properties.put(LoxoneBindingConstants.MINISERVER_PARAM_HOST, host);
properties.put(LoxoneBindingConstants.MINISERVER_PARAM_PORT, port);
properties.put(Thing.PROPERTY_VENDOR, vendor);
properties.put(Thing.PROPERTY_MODEL_ID, model);
properties.put(Thing.PROPERTY_SERIAL_NUMBER, serial);
return DiscoveryResultBuilder.create(uid).withProperties(properties).withLabel(label)
.withRepresentationProperty(serial).build();
}
return null;
}
开发者ID:ppieczul,项目名称:org.openhab.binding.loxone,代码行数:29,代码来源:LoxoneMiniserverDiscoveryParticipant.java
示例3: createResult
import org.jupnp.model.meta.DeviceDetails; //导入依赖的package包/类
@Override
public DiscoveryResult createResult(RemoteDevice device) {
ThingUID uid = getThingUID(device);
if (uid != null) {
DeviceDetails details = device.getDetails();
Map<String, Object> properties = new HashMap<>(3);
properties.put("gatewayAddress", details.getBaseURL().getHost());
logger.debug("Discovered a Homegear gateway with serial number '{}'", details.getSerialNumber());
return DiscoveryResultBuilder.create(uid).withProperties(properties)
.withLabel(details.getModelDetails().getModelNumber()).build();
}
return null;
}
示例4: getThingUID
import org.jupnp.model.meta.DeviceDetails; //导入依赖的package包/类
@Override
public ThingUID getThingUID(RemoteDevice device) {
if (device != null) {
DeviceDetails details = device.getDetails();
String modelName = details.getModelDetails().getModelName();
if ("HOMEGEAR".equalsIgnoreCase(modelName)) {
return new ThingUID(THING_TYPE_BRIDGE, details.getSerialNumber());
}
}
return null;
}
示例5: getThingUID
import org.jupnp.model.meta.DeviceDetails; //导入依赖的package包/类
/**
* Compute a FRITZ!Box thind UID.
*/
@Override
public ThingUID getThingUID(RemoteDevice device) {
DeviceDetails details = device.getDetails();
if (details != null) {
ModelDetails modelDetails = details.getModelDetails();
if (modelDetails != null) {
String modelName = modelDetails.getModelName();
if (modelName != null) {
if (modelName.startsWith(BRIDGE_MODEL_NAME)) {
logger.debug("discovered on {}", device.getIdentity().getDiscoveredOnLocalAddress());
return new ThingUID(BRIDGE_THING_TYPE,
device.getIdentity().getDescriptorURL().getHost()
// It world be better to use udn but in my case FB is discovered twice
// .getIdentity().getUdn().getIdentifierString()
.replaceAll("[^a-zA-Z0-9_]", "_"));
} else if (modelName.startsWith(PL546E_MODEL_NAME)) {
logger.debug("discovered on {}", device.getIdentity().getDiscoveredOnLocalAddress());
return new ThingUID(PL546E_STANDALONE_THING_TYPE,
device.getIdentity().getDescriptorURL().getHost()
// It world be better to use udn but in my case PL546E is discovered twice
// .getIdentity().getUdn().getIdentifierString()
.replaceAll("[^a-zA-Z0-9_]", "_"));
}
}
} else {
logger.debug("no model details");
}
}
return null;
}