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.lametrictime.internal.api.dto.enums;
15 import org.openhab.binding.lametrictime.internal.api.dto.ApiValue;
20 * @author Gregory Moyer - Initial contribution
22 public enum Sound implements ApiValue {
23 BICYCLE(SoundCategory.NOTIFICATIONS),
24 CAR(SoundCategory.NOTIFICATIONS),
25 CASH(SoundCategory.NOTIFICATIONS),
26 CAT(SoundCategory.NOTIFICATIONS),
27 DOG(SoundCategory.NOTIFICATIONS),
28 DOG2(SoundCategory.NOTIFICATIONS),
29 ENERGY(SoundCategory.NOTIFICATIONS),
30 KNOCK_KNOCK(SoundCategory.NOTIFICATIONS, "knock-knock"),
31 LETTER_EMAIL(SoundCategory.NOTIFICATIONS),
32 LOSE1(SoundCategory.NOTIFICATIONS),
33 LOSE2(SoundCategory.NOTIFICATIONS),
34 NEGATIVE1(SoundCategory.NOTIFICATIONS),
35 NEGATIVE2(SoundCategory.NOTIFICATIONS),
36 NEGATIVE3(SoundCategory.NOTIFICATIONS),
37 NEGATIVE4(SoundCategory.NOTIFICATIONS),
38 NEGATIVE5(SoundCategory.NOTIFICATIONS),
39 NOTIFICATION(SoundCategory.NOTIFICATIONS),
40 NOTIFICATION2(SoundCategory.NOTIFICATIONS),
41 NOTIFICATION3(SoundCategory.NOTIFICATIONS),
42 NOTIFICATION4(SoundCategory.NOTIFICATIONS),
43 OPEN_DOOR(SoundCategory.NOTIFICATIONS),
44 POSITIVE1(SoundCategory.NOTIFICATIONS),
45 POSITIVE2(SoundCategory.NOTIFICATIONS),
46 POSITIVE3(SoundCategory.NOTIFICATIONS),
47 POSITIVE4(SoundCategory.NOTIFICATIONS),
48 POSITIVE5(SoundCategory.NOTIFICATIONS),
49 POSITIVE6(SoundCategory.NOTIFICATIONS),
50 STATISTIC(SoundCategory.NOTIFICATIONS),
51 THUNDER(SoundCategory.NOTIFICATIONS),
52 WATER1(SoundCategory.NOTIFICATIONS),
53 WATER2(SoundCategory.NOTIFICATIONS),
54 WIN(SoundCategory.NOTIFICATIONS),
55 WIN2(SoundCategory.NOTIFICATIONS),
56 WIND(SoundCategory.NOTIFICATIONS),
57 WIND_SHORT(SoundCategory.NOTIFICATIONS),
59 ALARM1(SoundCategory.ALARMS),
60 ALARM2(SoundCategory.ALARMS),
61 ALARM3(SoundCategory.ALARMS),
62 ALARM4(SoundCategory.ALARMS),
63 ALARM5(SoundCategory.ALARMS),
64 ALARM6(SoundCategory.ALARMS),
65 ALARM7(SoundCategory.ALARMS),
66 ALARM8(SoundCategory.ALARMS),
67 ALARM9(SoundCategory.ALARMS),
68 ALARM10(SoundCategory.ALARMS),
69 ALARM11(SoundCategory.ALARMS),
70 ALARM12(SoundCategory.ALARMS),
71 ALARM13(SoundCategory.ALARMS);
73 private final SoundCategory category;
74 private final String rawValue;
76 private Sound(SoundCategory category) {
80 private Sound(SoundCategory category, String rawValue) {
81 this.category = category;
82 this.rawValue = rawValue;
85 public SoundCategory getCategory() {
90 public String toRaw() {
91 return rawValue != null ? rawValue : name().toLowerCase();
94 public static Sound toEnum(String raw) {
99 if (KNOCK_KNOCK.rawValue.equals(raw)) {
104 return valueOf(raw.toUpperCase());
105 } catch (IllegalArgumentException e) {
106 // not a valid raw string