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>
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);