use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.serverconnection.impl.DsAPIImpl in project smarthome by eclipse.
the class ConnectionManagerImpl method init.
private void init(Config config, boolean acceptAllCerts) {
this.config = config;
this.transport = new HttpTransportImpl(this, acceptAllCerts);
this.digitalSTROMClient = new DsAPIImpl(transport);
if (this.genAppToken) {
this.onNotAuthenticated();
}
}
use of org.eclipse.smarthome.binding.digitalstrom.internal.lib.serverconnection.impl.DsAPIImpl in project smarthome by eclipse.
the class BridgeMDNSDiscoveryParticipant method getThingUID.
@Override
public ThingUID getThingUID(ServiceInfo service) {
if (service.getApplication().contains("dssweb")) {
String hostAddress = service.getName() + "." + service.getDomain() + ".";
DsAPI digitalSTROMClient = new DsAPIImpl(hostAddress, Config.DEFAULT_CONNECTION_TIMEOUT, Config.DEFAULT_READ_TIMEOUT, true);
Map<String, String> dsidMap = digitalSTROMClient.getDSID(null);
String dSID = null;
if (dsidMap != null) {
dSID = dsidMap.get(JSONApiResponseKeysEnum.DSID.getKey());
}
if (StringUtils.isNotBlank(dSID)) {
return new ThingUID(DigitalSTROMBindingConstants.THING_TYPE_DSS_BRIDGE, dSID);
} else {
logger.error("Can't get server dSID to generate thing UID. Please add the server manually.");
}
}
return null;
}
Aggregations