]> git.basschouten.com Git - openhab-addons.git/commit
[homekit] persist all known accessories, to prevent loss of homekit information ...
authorCody Cutrer <cody@cutrer.us>
Thu, 8 Dec 2022 12:52:30 +0000 (05:52 -0700)
committerGitHub <noreply@github.com>
Thu, 8 Dec 2022 12:52:30 +0000 (13:52 +0100)
commit6a16c889f2caa041bbd9080fa0878e3ea6df7a5e
tree83024197229f86738ee1ca01234cdb0241568f55
parent3c936dbda978b8103f88e05979461511f6a95d13
[homekit] persist all known accessories, to prevent loss of homekit information (#13484)

* [homekit] persist all known accessories, to prevent loss of homekit information

See the readme for more details, but basically this keeps track of every
accessory we've ever created, and if it no longer exists, presents a dummy
accessory instead. If the accessory comes back, nothing is lost in the Home
app; if you meant to prune it permanently, you have to run a console command.

there are also several fixes to prevent presenting the device with missing data -
such as when the bundle stops, _don't_ explicitly remove the accessories until
the server has stopped.

we also don't increment the configuration version unless the configuration
has _actually_ changed (so removing and re-adding the exact same thing
won't trigger the device to reconnect). this even works across restarts
of the bundle, because we're persisting all the accessory information
for dummy information anyway.

* [homekit] Address review comments for accessory persistence

* update hap-java to 2.0.4
* remove unused local variable
* [homekit] ensure accessories are replaced in a batch

so that HAP-Java can maintain subscriptions with the new objects

* [homekit] log individual dummy accessories up to 5
* [homekit] Tweak readme for dummy accessories slightly.

 * Be consistent with proper usage of useDummyAccessories.
 * Make the sentence more clear about the effects of having dummy accessories.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
17 files changed:
bundles/org.openhab.io.homekit/README.md
bundles/org.openhab.io.homekit/pom.xml
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/Homekit.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/Debouncer.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryRegistry.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCommandExtension.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitSettings.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/BooleanItemReader.java
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/DummyHomekitAccessory.java [new file with mode: 0644]
bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java
bundles/org.openhab.io.homekit/src/main/resources/OH-INF/config/config.xml
bundles/org.openhab.io.homekit/src/main/resources/OH-INF/i18n/homekit.properties