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.venstarthermostat.internal.dto;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link VenstarSchedulePart} represents the schedule part (part of day) returned
21 * @author Matthew Davies - Initial contribution
24 public enum VenstarSchedulePart {
25 MORNING(0, "morning", "Morning"),
27 EVENING(2, "evening", "Evening"),
28 NIGHT(3, "night", "Night"),
29 INACTIVE(255, "inactive", "Inactive");
33 private String friendlyName;
35 VenstarSchedulePart(int part, String name, String friendlyName) {
38 this.friendlyName = friendlyName;
45 public String partName() {
49 public String friendlyName() {
53 public static VenstarSchedulePart fromInt(int part) throws IllegalArgumentException {
54 for (VenstarSchedulePart sp : values()) {
55 if (sp.part == part) {
60 throw (new IllegalArgumentException("Invalid schedule part " + part));