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.scene.constants;
15 import java.util.HashMap;
19 * The {@link ApartmentSceneEnum} lists all group independent scenes from digitalSTROM which are callable at the
20 * digitalSTROM web interface.
22 * @author Alexander Betker - Initial contribution
24 * @author Michael Ochel - add new scenes and deleted scenes which are show as zone scenes in the dss-web-interface
25 * @author Mathias Siegele - add new scenes and deleted scenes which are show as zone scenes in the dss-web-interface
27 public enum ApartmentSceneEnum implements Scene {
29 * see http://developer.digitalstrom.org/Architecture/ds-basics.pdf , Table 35: Group independent activities and
31 * command values, page 47 and dss-web-interface
34 ENERGY_OVERLOAD((short) 66),
35 ZONE_ACTIVE((short) 75),
36 ALARM_SIGNAL((short) 74),
37 AUTO_STANDBY((short) 64),
40 DOOR_BELL((short) 73),
54 private final short sceneNumber;
55 static final Map<Short, ApartmentSceneEnum> APARTAMENT_SCENES = new HashMap<>();
58 for (ApartmentSceneEnum as : ApartmentSceneEnum.values()) {
59 APARTAMENT_SCENES.put(as.getSceneNumber(), as);
63 private ApartmentSceneEnum(Short sceneNumber) {
64 this.sceneNumber = sceneNumber;
68 * Returns the apartment scene from the given scene number.
70 * @param sceneNumber of the {@link ApartmentSceneEnum}
71 * @return apartment scene
73 public static ApartmentSceneEnum getApartmentScene(short sceneNumber) {
74 return APARTAMENT_SCENES.get(sceneNumber);
78 * Returns true, if the given scene number contains in digitalSTROM apartment scenes, otherwise false.
80 * @param sceneNumber to be checked
81 * @return true, if contains, otherwise false
83 public static boolean containsScene(Short sceneNumber) {
84 return APARTAMENT_SCENES.keySet().contains(sceneNumber);
88 public Short getSceneNumber() {
89 return this.sceneNumber;