From dff665162e53332882aabdd7bca93766ad3347e7 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Mon, 29 Jul 2024 15:32:47 -0600 Subject: [PATCH] [homekit] Fix invertedness of GarageDoorOpener characteristics In #17137, CurrentDoorState and TargetDoorState were moved from being part of the accessory itself, to using the CharacteristicFactory, but they lost the flag that default-inverts them. So make sure to pass that flag in the new location that the mapping is created. Signed-off-by: Cody Cutrer --- .../internal/accessories/HomekitCharacteristicFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java index 5797e6238dce2..bc5047c992557 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java @@ -856,7 +856,7 @@ private static CoolingThresholdTemperatureCharacteristic createCoolingThresholdC private static CurrentDoorStateCharacteristic createCurrentDoorStateCharacteristic(HomekitTaggedItem taggedItem, HomekitAccessoryUpdater updater) { List validValues = new ArrayList<>(); - var map = createMapping(taggedItem, CurrentDoorStateEnum.class, validValues); + var map = createMapping(taggedItem, CurrentDoorStateEnum.class, validValues, true); return new CurrentDoorStateCharacteristic(() -> getEnumFromItem(taggedItem, map, CurrentDoorStateEnum.CLOSED), getSubscriber(taggedItem, CURRENT_DOOR_STATE, updater), getUnsubscriber(taggedItem, CURRENT_DOOR_STATE, updater)); @@ -1427,7 +1427,7 @@ private static SwingModeCharacteristic createSwingModeCharacteristic(HomekitTagg private static TargetDoorStateCharacteristic createTargetDoorStateCharacteristic(HomekitTaggedItem taggedItem, HomekitAccessoryUpdater updater) { List validValues = new ArrayList<>(); - var map = createMapping(taggedItem, TargetDoorStateEnum.class, validValues); + var map = createMapping(taggedItem, TargetDoorStateEnum.class, validValues, true); return new TargetDoorStateCharacteristic(() -> getEnumFromItem(taggedItem, map, TargetDoorStateEnum.CLOSED), (targetState) -> setValueFromEnum(taggedItem, targetState, map), getSubscriber(taggedItem, TARGET_DOOR_STATE, updater),