[homekit] update java hap library (#12267)

* update hap
* correction for categories

Signed-off-by: Eugen Freiter <freiter@gmx.de>
This commit is contained in:
eugen 2022-02-12 15:07:58 +01:00 committed by GitHub
parent 35a6fdde60
commit 5901479f0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -22,7 +22,7 @@
<dependency>
<groupId>io.github.hap-java</groupId>
<artifactId>hap</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -51,6 +51,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.hapjava.accessories.HomekitAccessory;
import io.github.hapjava.server.HomekitAccessoryCategories;
import io.github.hapjava.server.impl.HomekitRoot;
import io.github.hapjava.server.impl.HomekitServer;
import io.github.hapjava.server.impl.crypto.HAPSetupCodeUtils;
@ -175,9 +176,10 @@ public class HomekitImpl implements Homekit, NetworkAddressChangeListener {
private void startBridge() throws IOException {
final @Nullable HomekitServer homekitServer = this.homekitServer;
if (homekitServer != null && bridge == null) {
final HomekitRoot bridge = homekitServer.createBridge(authInfo, settings.name, HomekitSettings.MANUFACTURER,
HomekitSettings.MODEL, HomekitSettings.SERIAL_NUMBER,
FrameworkUtil.getBundle(getClass()).getVersion().toString(), HomekitSettings.HARDWARE_REVISION);
final HomekitRoot bridge = homekitServer.createBridge(authInfo, settings.name,
HomekitAccessoryCategories.BRIDGES, HomekitSettings.MANUFACTURER, HomekitSettings.MODEL,
HomekitSettings.SERIAL_NUMBER, FrameworkUtil.getBundle(getClass()).getVersion().toString(),
HomekitSettings.HARDWARE_REVISION);
changeListener.setBridge(bridge);
this.bridge = bridge;
bridge.setConfigurationIndex(changeListener.getConfigurationRevision());
@ -297,7 +299,7 @@ public class HomekitImpl implements Homekit, NetworkAddressChangeListener {
logger.trace("removed interface {}", i.getAddress().toString());
if (i.getAddress().equals(networkInterface)) {
final @Nullable HomekitRoot bridge = this.bridge;
if (this.bridge != null) {
if (bridge != null) {
bridge.stop();
this.bridge = null;
}

View File

@ -649,8 +649,14 @@ public class HomekitCharacteristicFactory {
private static RotationSpeedCharacteristic createRotationSpeedCharacteristic(HomekitTaggedItem item,
HomekitAccessoryUpdater updater) {
return new RotationSpeedCharacteristic(getIntSupplier(item, 0), setPercentConsumer(item),
getSubscriber(item, ROTATION_SPEED, updater), getUnsubscriber(item, ROTATION_SPEED, updater));
return new RotationSpeedCharacteristic(
item.getConfigurationAsDouble(HomekitTaggedItem.MIN_VALUE,
RotationSpeedCharacteristic.DEFAULT_MIN_VALUE),
item.getConfigurationAsDouble(HomekitTaggedItem.MAX_VALUE,
RotationSpeedCharacteristic.DEFAULT_MAX_VALUE),
item.getConfigurationAsDouble(HomekitTaggedItem.STEP, RotationSpeedCharacteristic.DEFAULT_STEP),
getDoubleSupplier(item, 0), setDoubleConsumer(item), getSubscriber(item, ROTATION_SPEED, updater),
getUnsubscriber(item, ROTATION_SPEED, updater));
}
private static SetDurationCharacteristic createDurationCharacteristic(HomekitTaggedItem taggedItem,