[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>
This commit is contained in:
parent
e916974e38
commit
a191c16f50
@ -164,7 +164,15 @@ abstract class AbstractHomekitPositionAccessoryImpl extends AbstractHomekitAcces
|
|||||||
final Optional<HomekitTaggedItem> taggedItem = getCharacteristic(type);
|
final Optional<HomekitTaggedItem> taggedItem = getCharacteristic(type);
|
||||||
if (taggedItem.isPresent()) {
|
if (taggedItem.isPresent()) {
|
||||||
final Item item = taggedItem.get().getItem();
|
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);
|
value = item.getStateAs(PercentType.class);
|
||||||
} else {
|
} else {
|
||||||
value = item.getStateAs(DecimalType.class);
|
value = item.getStateAs(DecimalType.class);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user