2 * Copyright (c) 2010-2024 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.freeathomesystem.internal.valuestateconverter;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.library.types.StopMoveType;
17 import org.openhab.core.library.types.StringType;
18 import org.openhab.core.library.types.UpDownType;
19 import org.openhab.core.types.Command;
20 import org.openhab.core.types.State;
23 * The {@link ShuttercontrolValueStateConverter} is a value converter for shutter movement
25 * @author Andras Uhrin - Initial contribution
29 public class ShuttercontrolValueStateConverter implements ValueStateConverter {
32 public State convertToState(String value) {
33 State ret = UpDownType.DOWN;
38 ret = new StringType("STOP");
44 ret = UpDownType.DOWN;
52 public String convertToValueString(State state) {
53 String valueString = "0";
54 String stateString = "STOP";
56 if (state instanceof UpDownType) {
57 stateString = ((UpDownType) state).toString();
60 if (((Command) state) instanceof StopMoveType) {
64 switch (stateString) {