String json = request("/v2/devices/" + deviceId);
logger.trace("BondHome device info : {}", json);
try {
- return Objects.requireNonNull(gson.fromJson(json, BondDevice.class));
+ BondDevice device = Objects.requireNonNull(gson.fromJson(json, BondDevice.class));
+ device.actions.removeIf(Objects::isNull);
+ return device;
} catch (JsonParseException e) {
logger.debug("Could not parse device {}'s JSON '{}'", deviceId, json, e);
throw new BondException("@text/offline.comm-error.unparseable-response");
logger.debug("Repeated Bond API calls to {} failed.", uri);
bridgeHandler.setBridgeOffline(ThingStatusDetail.COMMUNICATION_ERROR,
"@text/offline.comm-error.api-call-failed");
- throw new BondException("@text/offline.conf-error.api-call-failed", true);
+ throw new BondException("@text/offline.comm-error.api-call-failed", true);
}
}
} while (true);
for (final String deviceId : deviceList) {
BondDevice thisDevice = api.getDevice(deviceId);
String deviceName;
- if ((deviceName = thisDevice.name) != null) {
+ if (thisDevice.type != null && (deviceName = thisDevice.name) != null) {
final ThingUID deviceUid = new ThingUID(thisDevice.type.getThingTypeUID(), bridgeUid, deviceId);
final DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(deviceUid)
.withBridge(bridgeUid).withLabel(thisDevice.name)
# thing status descriptions
-offline.comm-error.api-call-failed = Bond API call to {} failed: {}
+offline.comm-error.api-call-failed = Bond API call failed.
offline.comm-error.device-not-found = No Bond device found with the given device id.
offline.comm-error.no-api = Bond Bridge API not available.
offline.comm-error.no-response = No response received!