[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
parent
e916974e38
commit
a191c16f50
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue