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.ecobee.internal.enums;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
18 import com.google.gson.annotations.SerializedName;
21 * The {@link PlugState} defines the possible plug states.
23 * @author Mark Hilbush - Initial contribution
26 public enum PlugState {
29 * Sets the plug into the on state for the start/end period specified.
30 * Creates a plug hold in the on state.
36 * Sets the plug into the off state for the start/end period specified.
37 * Creates a plug hold in the off state.
39 @SerializedName("off")
43 * Causes the plug to resume its regular program and to follow it. Removes
44 * the currently active plug hold, if no hold is currently running, nothing
45 * happens. No other optional properties are used.
47 @SerializedName("resume")
50 private final String state;
52 private PlugState(String state) {
56 public static PlugState forValue(@Nullable String v) {
58 for (PlugState ps : PlugState.values()) {
59 if (ps.state.equals(v)) {
64 throw new IllegalArgumentException("Invalid plug state: " + v);
68 public String toString() {