Skip to content

Commit

Permalink
[homekit] Fix invertedness of GarageDoorOpener characteristics (#17181)
Browse files Browse the repository at this point in the history
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 <cody@cutrer.us>
  • Loading branch information
ccutrer authored Jul 30, 2024
1 parent 077cea0 commit cc6a202
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ private static CoolingThresholdTemperatureCharacteristic createCoolingThresholdC
private static CurrentDoorStateCharacteristic createCurrentDoorStateCharacteristic(HomekitTaggedItem taggedItem,
HomekitAccessoryUpdater updater) {
List<CurrentDoorStateEnum> 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));
Expand Down Expand Up @@ -1427,7 +1427,7 @@ private static SwingModeCharacteristic createSwingModeCharacteristic(HomekitTagg
private static TargetDoorStateCharacteristic createTargetDoorStateCharacteristic(HomekitTaggedItem taggedItem,
HomekitAccessoryUpdater updater) {
List<TargetDoorStateEnum> 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),
Expand Down

0 comments on commit cc6a202

Please sign in to comment.