Finalized handling for barmony. Added a version call for use in api.

Updated version handling in the pom.xml and code. Removed
vtwocompatibility as it should not be used.
This commit is contained in:
Admin
2015-11-03 15:16:01 -06:00
parent 408b79d5d8
commit e29f12905d
13 changed files with 103 additions and 119 deletions

View File

@@ -40,53 +40,6 @@ public class UpnpSettingsResource {
+ "<depth>24</depth>\n" + "<url>hue_logo_3.png</url>\n" + "</icon>\n" + "</iconList>\n" + "</device>\n"
+ "</root>\n";
private String hueTemplateVTwo = "<?xml version=\"1.0\"?>\n" +
"<root xmlns=\"urn:schemas-upnp-org:device-1-0\">\n" +
"<specVersion>\n" +
"<major>1</major>\n" +
"<minor>0</minor>\n" +
"</specVersion>\n" +
"<URLBase>http://%s:%s/</URLBase>\n" + //hostname string
"<device>\n" +
"<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>\n" +
"<friendlyName>Amazon-Echo-HA-Bridge (%s)</friendlyName>\n" +
"<manufacturer>Royal Philips Electronics</manufacturer>\n" +
"<manufacturerURL>http://www.bwssystems.com</manufacturerURL>\n" +
"<modelDescription>Hue Emulator for Amazon Echo bridge</modelDescription>\n" +
"<modelName>Philips hue bridge 2012</modelName>\n" +
"<modelNumber>929000226503</modelNumber>\n" +
"<modelURL>http://www.bwssystems.com/apps.html</modelURL>\n" +
"<serialNumber>01189998819991197253</serialNumber>\n" +
"<UDN>uuid:88f6698f-2c83-4393-bd03-cd54a9f8595</UDN>\n" +
"<serviceList>\n" +
"<service>\n" +
"<serviceType>(null)</serviceType>\n" +
"<serviceId>(null)</serviceId>\n" +
"<controlURL>(null)</controlURL>\n" +
"<eventSubURL>(null)</eventSubURL>\n" +
"<SCPDURL>(null)</SCPDURL>\n" +
"</service>\n" +
"</serviceList>\n" +
"<presentationURL>index.html</presentationURL>\n" +
"<iconList>\n" +
"<icon>\n" +
"<mimetype>image/png</mimetype>\n" +
"<height>48</height>\n" +
"<width>48</width>\n" +
"<depth>24</depth>\n" +
"<url>hue_logo_0.png</url>\n" +
"</icon>\n" +
"<icon>\n" +
"<mimetype>image/png</mimetype>\n" +
"<height>120</height>\n" +
"<width>120</width>\n" +
"<depth>24</depth>\n" +
"<url>hue_logo_3.png</url>\n" +
"</icon>\n" +
"</iconList>\n" +
"</device>\n" +
"</root>\n";
public UpnpSettingsResource(BridgeSettings theSettings) {
super();
this.theSettings = theSettings;
@@ -102,10 +55,7 @@ public class UpnpSettingsResource {
log.debug("upnp device settings requested: " + request.params(":id") + " from " + request.ip() + ":" + request.port());
String portNumber = Integer.toString(request.port());
String filledTemplate = null;
if(theSettings.isVtwocompatibility())
filledTemplate = String.format(hueTemplateVTwo, theSettings.getUpnpConfigAddress(), portNumber, theSettings.getUpnpConfigAddress());
else
filledTemplate = String.format(hueTemplate, theSettings.getUpnpConfigAddress(), portNumber, theSettings.getUpnpConfigAddress());
filledTemplate = String.format(hueTemplate, theSettings.getUpnpConfigAddress(), portNumber, theSettings.getUpnpConfigAddress());
if(theSettings.isTraceupnp())
log.info("Traceupnp: upnp device settings response: " + filledTemplate);
else