]> git.basschouten.com Git - openhab-addons.git/blob
30c0b1c6eaea18f38a67e25273554d8a5c72914b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.hue.internal.dto.clip2.enums;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Enum for product archetypes.
20  *
21  * @see <a href="https://developers.meethue.com/develop/hue-api-v2/api-reference/#resource_light_get">API v2
22  *      documentation</a>
23  *
24  * @author Andrew Fiddian-Green - Initial contribution
25  */
26 @NonNullByDefault
27 public enum Archetype {
28     // device archetypes
29     BRIDGE_V2,
30     UNKNOWN_ARCHETYPE,
31     CLASSIC_BULB,
32     SULTAN_BULB,
33     FLOOD_BULB,
34     SPOT_BULB,
35     CANDLE_BULB,
36     LUSTER_BULB,
37     PENDANT_ROUND,
38     PENDANT_LONG,
39     CEILING_ROUND,
40     CEILING_SQUARE,
41     FLOOR_SHADE,
42     FLOOR_LANTERN,
43     TABLE_SHADE,
44     RECESSED_CEILING,
45     RECESSED_FLOOR,
46     SINGLE_SPOT,
47     DOUBLE_SPOT,
48     TABLE_WASH,
49     WALL_LANTERN,
50     WALL_SHADE,
51     FLEXIBLE_LAMP,
52     GROUND_SPOT,
53     WALL_SPOT,
54     PLUG,
55     HUE_GO,
56     HUE_LIGHTSTRIP,
57     HUE_IRIS,
58     HUE_BLOOM,
59     BOLLARD,
60     WALL_WASHER,
61     HUE_PLAY,
62     VINTAGE_BULB,
63     CHRISTMAS_TREE,
64     HUE_CENTRIS,
65     HUE_LIGHTSTRIP_TV,
66     HUE_TUBE,
67     HUE_SIGNE,
68     STRING_LIGHT,
69     // room archetypes
70     LIVING_ROOM,
71     KITCHEN,
72     DINING,
73     BEDROOM,
74     KIDS_BEDROOM,
75     BATHROOM,
76     NURSERY,
77     RECREATION,
78     OFFICE,
79     GYM,
80     HALLWAY,
81     TOILET,
82     FRONT_DOOR,
83     GARAGE,
84     TERRACE,
85     GARDEN,
86     DRIVEWAY,
87     CARPORT,
88     HOME,
89     DOWNSTAIRS,
90     UPSTAIRS,
91     TOP_FLOOR,
92     ATTIC,
93     GUEST_ROOM,
94     STAIRCASE,
95     LOUNGE,
96     MAN_CAVE,
97     COMPUTER,
98     STUDIO,
99     MUSIC,
100     TV,
101     READING,
102     CLOSET,
103     STORAGE,
104     LAUNDRY_ROOM,
105     BALCONY,
106     PORCH,
107     BARBECUE,
108     POOL,
109     OTHER;
110
111     public static Archetype of(@Nullable String value) {
112         if (value != null) {
113             try {
114                 return valueOf(value.toUpperCase());
115             } catch (IllegalArgumentException e) {
116                 // fall through
117             }
118         }
119         return UNKNOWN_ARCHETYPE;
120     }
121
122     @Override
123     public String toString() {
124         String s = this.name().replace("_", " ");
125         return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
126     }
127 }