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.sleepiq.internal.api.enums;
15 import static org.openhab.binding.sleepiq.internal.SleepIQBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import com.google.gson.annotations.SerializedName;
22 * The {@link FoundationActuator} represents actuators at the head and foot of the bed side.
24 * @author Mark Hilbush - Initial contribution
27 public enum FoundationActuator {
34 private final String actuator;
36 FoundationActuator(final String actuator) {
37 this.actuator = actuator;
40 public String value() {
44 public static FoundationActuator forValue(String value) {
45 for (FoundationActuator s : FoundationActuator.values()) {
46 if (s.actuator.equals(value)) {
50 throw new IllegalArgumentException("Invalid actuator: " + value);
53 public static FoundationActuator convertFromChannelId(String channelId) {
54 FoundationActuator localActuator;
56 case CHANNEL_RIGHT_POSITION_HEAD:
57 case CHANNEL_LEFT_POSITION_HEAD:
58 localActuator = FoundationActuator.HEAD;
60 case CHANNEL_RIGHT_POSITION_FOOT:
61 case CHANNEL_LEFT_POSITION_FOOT:
62 localActuator = FoundationActuator.FOOT;
65 throw new IllegalArgumentException("Can't convert channel to actuator: " + channelId);
71 public String toString() {