public static final String IP_ADDRESS = "ipAddress";
public static final String USAGE_INTERVAL = "usageInterval";
public static final String STATUS_INTERVAL = "statusInterval";
+ public static final String UUID = "uuid";
public @Nullable String ipAddress;
public int usageInterval;
public int statusInterval;
+ public @Nullable String uuid;
}
String label = service.getName();
properties.put(HPPrinterConfiguration.IP_ADDRESS, inetAddress);
- DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties).withLabel(label)
- .build();
+ properties.put(HPPrinterConfiguration.UUID, service.getPropertyString("UUID"));
+ DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties)
+ .withRepresentationProperty(HPPrinterConfiguration.UUID).withLabel(label).build();
logger.trace("Created a DiscoveryResult {} for printer on host '{}' name '{}'", result, inetAddress,
label);
return result;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.binding.hpprinter.internal.HPPrinterConfiguration;
import org.openhab.core.thing.Thing;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
element.getElementsByTagName("dd:SerialNumber").item(0).getTextContent());
properties.put(Thing.PROPERTY_MODEL_ID,
element.getElementsByTagName("dd:ProductNumber").item(0).getTextContent());
+ properties.put(HPPrinterConfiguration.UUID,
+ element.getElementsByTagName("dd:UUID").item(0).getTextContent());
Node firmwareDate = element.getElementsByTagName("dd:Version").item(0);
properties.put(Thing.PROPERTY_FIRMWARE_VERSION, firmwareDate.getChildNodes().item(0).getTextContent());
}
</channel-groups>
<properties>
<property name="vendor">HP</property>
+ <property name="uuid"></property>
</properties>
- <representation-property>serialNumber</representation-property>
+ <representation-property>uuid</representation-property>
<config-description-ref uri="thing-type:hpprinter:config"/>
</thing-type>