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.digitalstrom.internal.lib.structure.devices.deviceparameters.constants;
15 import java.util.HashMap;
19 * digitalSTROM Application Groups.
22 | Group ID | Name | Color | Application |
23 | -------- | --------------------- | ------- | ----------------------------------- |
24 | 1 | Lights | Yellow | Room lights |
25 | 2 | Blinds | Gray | Blinds, curtains, shades, awnings |
26 | 3 | Heating | Blue | Heating |
27 | 9 | Cooling | Blue | Cooling |
28 | 10 | Ventilation | Blue | Ventilation |
29 | 11 | Window | Blue | Windows |
30 | 12 | Recirculation | Blue | Ceiling fan, Fan coil units |
31 | 64 | Apartment Ventilation | Blue | Ventilation system |
32 | 48 | Temperature Control | Blue | Single room temperature control |
33 | 4 | Audio | Cyan | Playing music or radio |
34 | 5 | Video | Magenta | TV, Video |
35 | 8 | Joker | Black | Configurable |
36 | n/a | Single Device | White | Various, individual per device |
37 | n/a | Security | Red | Security related functions, Alarms |
38 | n/a | Access | Green | Access related functions, door bell |
41 * @author Rouven Schürch - Initial contribution
42 * @see <a href="https://developer.digitalstrom.org/Architecture/ds-basics.pdf">ds-basics.pdf</a> (Version 1.4/1.6),
43 * chapter 3.2 (Group), Table 2.
46 public enum ApplicationGroup {
48 LIGHTS((short) 1, Color.YELLOW),
49 BLINDS((short) 2, Color.GREY),
50 HEATING((short) 3, Color.BLUE),
51 COOLING((short) 9, Color.BLUE),
52 VENTILATION((short) 10, Color.BLUE),
53 WINDOW((short) 11, Color.BLUE),
54 RECIRCULATION((short) 12, Color.BLUE),
55 APARTMENT_VENTILATION((short) 64, Color.BLUE),
56 TEMPERATURE_CONTROL((short) 48, Color.BLUE),
57 AUDIO((short) 4, Color.CYAN),
58 VIDEO((short) 5, Color.MAGENTA),
59 JOKER((short) 8, Color.BLACK),
60 SINGLE_DEVICE((short) -1, Color.WHITE),
61 SECURITY((short) -2, Color.RED),
62 ACCESS((short) -3, Color.GREEN),
63 UNDEFINED(null, Color.UNDEFINED);
78 private Short groupId;
80 static final Map<Short, ApplicationGroup> APPLICATION_GROUPS = new HashMap<>();
85 for (ApplicationGroup applications : ApplicationGroup.values()) {
86 APPLICATION_GROUPS.put(applications.getId(), applications);
90 private ApplicationGroup(Short groupId, Color color) {
91 this.groupId = groupId;
95 public Short getId() {
100 * Returns the corresponding ApplicationGroup or ApplicationGroup.UNDEFINED if
101 * there is no ApplicationGroup for the given groupId.
104 * @return ApplicationGroup or ApplicationGroup.UNDEFINED
106 public static ApplicationGroup getGroup(Short groupId) {
107 return APPLICATION_GROUPS.containsKey(groupId) ? APPLICATION_GROUPS.get(groupId) : ApplicationGroup.UNDEFINED;
110 public Color getColor() {