Skip to content

Commit

Permalink
[homekit] update AuthInfo objects when blockUserDeletion changes (ope…
Browse files Browse the repository at this point in the history
…nhab#14017)

* [homekit] update AuthInfo objects when blockUserDeletion changes

Signed-off-by: Cody Cutrer <[email protected]>

* [homekit] general cleanup of redundant method call and unused local vars

Signed-off-by: Cody Cutrer <[email protected]>

Signed-off-by: Cody Cutrer <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
  • Loading branch information
ccutrer authored and andrasU committed Jan 6, 2024
1 parent c08b0d8 commit dcbbcb4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ protected synchronized void modified(Map<String, Object> 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());
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit dcbbcb4

Please sign in to comment.