diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java index ba538f8a7cc47..941081150f147 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java @@ -57,6 +57,10 @@ public HomekitAuthInfoImpl(Storage storage, String pin, String setupId, initializeStorage(); } + public void setBlockUserDeletion(boolean blockUserDeletion) { + this.blockUserDeletion = blockUserDeletion; + } + @Override public void createUser(String username, byte[] publicKey) { logger.trace("create user {}", username); diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java index 7e4da4a9ac1fe..8353bedc121b2 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java @@ -171,6 +171,11 @@ protected synchronized void modified(Map config) { for (HomekitChangeListener changeListener : changeListeners) { changeListener.updateSettings(settings); } + if (settings.blockUserDeletion != oldSettings.blockUserDeletion) { + for (HomekitAuthInfoImpl authInfo : authInfos) { + authInfo.setBlockUserDeletion(settings.blockUserDeletion); + } + } } } catch (IOException | InvalidAlgorithmParameterException e) { logger.warn("could not initialize HomeKit bridge: {}", e.getMessage()); @@ -203,10 +208,6 @@ private HomekitRoot startBridge(HomekitServer homekitServer, HomekitAuthInfoImpl changeListener.setBridge(bridge); bridges.add(bridge); bridge.setConfigurationIndex(changeListener.getConfigurationRevision()); - bridge.refreshAuthInfo(); - - final int lastAccessoryCount = changeListener.getLastAccessoryCount(); - int currentAccessoryCount = changeListener.getAccessories().size(); bridge.start(); return bridge; }