[homekit] fix window coverings based on groups of rollershutters (#13232)

it was getting the state as a decimal type, not a percent type, so
it was getting 1 instead of 100.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
pull/13228/head
Cody Cutrer 2022-08-08 01:43:54 -06:00 committed by GitHub
parent e916974e38
commit a191c16f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -164,7 +164,15 @@ abstract class AbstractHomekitPositionAccessoryImpl extends AbstractHomekitAcces
final Optional<HomekitTaggedItem> taggedItem = getCharacteristic(type);
if (taggedItem.isPresent()) {
final Item item = taggedItem.get().getItem();
if ((item instanceof RollershutterItem) || ((item instanceof DimmerItem))) {
Item baseItem = item;
// Check the type of the base item for a group item
if (item instanceof GroupItem) {
baseItem = ((GroupItem) item).getBaseItem();
if (baseItem == null) {
baseItem = item;
}
}
if (baseItem instanceof RollershutterItem || baseItem instanceof DimmerItem) {
value = item.getStateAs(PercentType.class);
} else {
value = item.getStateAs(DecimalType.class);