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 ZoneSceneEnum} lists all zone scenes which are available on the dSS-web-interface.
21 * @author Michael Ochel - Initial contribution
22 * @author Matthias Siegele - Initial contribution
24 public enum ZoneSceneEnum implements Scene {
31 private final short sceneNumber;
32 static final Map<Short, ZoneSceneEnum> ZONE_SCENES = new HashMap<>();
35 for (ZoneSceneEnum zs : ZoneSceneEnum.values()) {
36 ZONE_SCENES.put(zs.getSceneNumber(), zs);
40 private ZoneSceneEnum(short sceneNumber) {
41 this.sceneNumber = sceneNumber;
45 * Returns the {@link ZoneSceneEnum} of the given scene number.
47 * @param sceneNumber of the {@link ZoneSceneEnum}
48 * @return ZoneSceneEnum
50 public static ZoneSceneEnum getZoneScene(short sceneNumber) {
51 return ZONE_SCENES.get(sceneNumber);
55 * Returns true, if the given scene number contains in digitalSTROM zone scenes, otherwise false.
57 * @param sceneNumber to be checked
58 * @return true, if contains, otherwise false
60 public static boolean containsScene(Short sceneNumber) {
61 return ZONE_SCENES.keySet().contains(sceneNumber);
65 public Short getSceneNumber() {
66 return this.sceneNumber;