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.lifx.internal.dto;
15 import java.util.Arrays;
16 import java.util.Optional;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
21 * @author Wouter Born - Initial contribution
24 public enum LightLastHevCycleResult {
28 INTERRUPTED_BY_RESET(2),
29 INTERRUPTED_BY_HOMEKIT(3),
30 INTERRUPTED_BY_LAN(4),
31 INTERRUPTED_BY_CLOUD(5),
34 private final int type;
36 LightLastHevCycleResult(int type) {
40 public static LightLastHevCycleResult fromValue(int type) {
41 Optional<LightLastHevCycleResult> result = Arrays.stream(values()).filter((value) -> value.type == type)
44 if (result.isEmpty()) {
45 throw new IllegalArgumentException("Invalid LightLastHevCycleResult type: " + type);