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;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link HoldType} represents the possible hold types.
22 * @author John Cocula - Initial contribution
23 * @author Mark Hilbush - Adapt for OH2/3
26 public enum HoldType {
29 * Use the provided startDate, startTime, endDate and endTime for the event.
30 * If start date/time is not provided, it will be assumed to be right now.
31 * End date/time is required.
33 @SerializedName("dateTime")
34 DATE_TIME("dateTime"),
37 * The end date/time will be set to the next climate transition in the program.
39 @SerializedName("nextTransition")
40 NEXT_TRANSITION("nextTransition"),
43 * The hold will not end and require to be cancelled explicitly.
45 @SerializedName("indefinite")
46 INDEFINITE("indefinite"),
49 * Use the value in the holdHours parameter to set the end date/time for the event.
51 @SerializedName("holdHours")
52 HOLD_HOURS("holdHours");
54 private final String type;
56 private HoldType(final String type) {
60 public static HoldType forValue(String v) {
61 for (HoldType ht : HoldType.values()) {
62 if (ht.type.equals(v)) {
66 throw new IllegalArgumentException("Invalid hold type: " + v);
70 public String toString() {