Skip to content

Commit

Permalink
Revert "Add support for group item type to window covering (openhab#1…
Browse files Browse the repository at this point in the history
…0936)"

This reverts commit 66252b4.

Signed-off-by: dw-8 <davy.wong.on+github@gmail.com>
  • Loading branch information
dw-8 committed Jul 25, 2021
1 parent 445e1fe commit c26966e
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.items.GroupItem;
import org.openhab.core.items.Item;
import org.openhab.core.library.items.DimmerItem;
import org.openhab.core.library.items.NumberItem;
Expand Down Expand Up @@ -85,19 +84,12 @@ public CompletableFuture<Void> setTargetPosition(int value) {
getCharacteristic(TARGET_POSITION).ifPresentOrElse(taggedItem -> {
final Item item = taggedItem.getItem();
final int targetPosition = convertPosition(value, openPosition);

if (item instanceof RollershutterItem) {
((RollershutterItem) item).send(new PercentType(targetPosition));
} else if (item instanceof DimmerItem) {
((DimmerItem) item).send(new PercentType(targetPosition));
} else if (item instanceof NumberItem) {
((NumberItem) item).send(new DecimalType(targetPosition));
} else if (item instanceof GroupItem && ((GroupItem) item).getBaseItem() instanceof RollershutterItem) {
((GroupItem) item).send(new PercentType(targetPosition));
} else if (item instanceof GroupItem && ((GroupItem) item).getBaseItem() instanceof DimmerItem) {
((GroupItem) item).send(new PercentType(targetPosition));
} else if (item instanceof GroupItem && ((GroupItem) item).getBaseItem() instanceof NumberItem) {
((GroupItem) item).send(new DecimalType(targetPosition));
} else {
logger.warn(
"Unsupported item type for characteristic {} at accessory {}. Expected Rollershutter, Dimmer or Number item, got {}",
Expand Down

0 comments on commit c26966e

Please sign in to comment.