2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bluetooth.am43.internal.command;
15 import java.util.concurrent.Executor;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * The {@link GetPositionCommand} is used to get the current position of the blinds, ranging from 0 to 100.
23 * @author Connor Petty - Initial contribution
26 public class GetPositionCommand extends AM43Command {
28 private static final byte COMMAND = (byte) 0xa1;
30 public GetPositionCommand() {
31 super(COMMAND, (byte) 1);
35 public boolean handleResponse(Executor executor, ResponseListener listener, byte @Nullable [] response) {
36 if (super.handleResponse(executor, listener, response)) {
37 executor.execute(() -> listener.receivedResponse(this));
43 public int getPosition() {
44 return getResponse()[4];
48 public int minResponseSize() {