diff --git a/bundles/org.openhab.binding.bluetooth.bluez/pom.xml b/bundles/org.openhab.binding.bluetooth.bluez/pom.xml index 6a2e4a55a8f..40f651a3032 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/pom.xml +++ b/bundles/org.openhab.binding.bluetooth.bluez/pom.xml @@ -26,7 +26,7 @@ com.github.hypfvieh bluez-dbus-osgi - 0.1.3 + 0.1.4 provided diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java index d92bc360974..ed75d91daf0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZBluetoothDevice.java @@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.freedesktop.dbus.errors.NoReply; +import org.freedesktop.dbus.errors.UnknownObject; import org.freedesktop.dbus.exceptions.DBusException; import org.freedesktop.dbus.exceptions.DBusExecutionException; import org.freedesktop.dbus.types.UInt16; @@ -195,7 +196,12 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv BluetoothDevice dev = device; if (dev != null) { logger.debug("Disconnecting '{}'", address); - return dev.disconnect(); + try { + return dev.disconnect(); + } catch (UnknownObject exception) { + logger.debug("Failed to disconnect the device, UnknownObject", exception); + return false; + } } return false; }