Skip to content

Commit

Permalink
[homekit] set correct configuration revision on bundle start (#7702)
Browse files Browse the repository at this point in the history
Signed-off-by: Eugen Freiter <[email protected]>
  • Loading branch information
yfre authored May 21, 2020
1 parent d37ba79 commit c3b58fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public void setConfigurationRevision(int revision) {
configurationRevision = revision;
}

public int getConfigurationRevision() {
return configurationRevision;
}

public int makeNewConfigurationRevision() {
configurationRevision = (configurationRevision + 1) % 65535;
final HomekitRoot bridge = this.bridge;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ public Map<String, HomekitAccessory> getAccessories() {
return this.accessoryRegistry.getAllAccessories();
}

public int getConfigurationRevision() {
return this.accessoryRegistry.getConfigurationRevision();
}

/**
* creates one or more HomeKit items for given openhab item.
* one openhab item can linked to several HomeKit accessories or characteristics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void startBridge() throws InvalidAlgorithmParameterException, IOExceptio
FrameworkUtil.getBundle(getClass()).getVersion().toString(), HomekitSettings.SERIAL_NUMBER,
HomekitSettings.FIRMWARE_REVISION, HomekitSettings.HARDWARE_REVISION);
changeListener.setBridge(bridge);
bridge.setConfigurationIndex(changeListener.getConfigurationRevision());
bridge.start();
this.bridge = bridge;
} else {
Expand Down

0 comments on commit c3b58fc

Please sign in to comment.