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.listener;
15 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
18 * The {@link SceneStatusListener} is notified, if an {@link InternalScene} status has changed or a
19 * {@link InternalScene} has been removed or added.
22 * By implementation with the id {@link #SCENE_DISCOVERY} this listener can be used as a scene discovery to get
23 * informed, if a new {@link InternalScene}s is added or removed from the digitalSTROM-System.<br>
24 * For that the {@link SceneStatusListener} has to be registered on the
25 * {@link SceneManager#registerSceneListener(SceneStatusListener)}. Then the {@link SceneStatusListener} gets
26 * informed by the methods {@link #onSceneAdded(InternalScene)} and {@link #onSceneRemoved(InternalScene)}.
28 * @author Michael Ochel - Initial contribution
29 * @author Matthias Siegele - Initial contribution
31 public interface SceneStatusListener {
34 * The {@link SceneStatusListener} id for the discovery implementation.
36 static final String SCENE_DISCOVERY = "SceneDiscovery";
39 * This method is called whenever the state of the {@link InternalScene} has changed.
41 * @param newState (true = call | false = undo)
43 void onSceneStateChanged(boolean newState);
46 * This method is called whenever an {@link InternalScene} is removed.
48 * @param scene that was removed
50 void onSceneRemoved(InternalScene scene);
53 * This method is called whenever an {@link InternalScene} is added.
55 * @param scene that was added
57 void onSceneAdded(InternalScene scene);
60 * Return the id of this {@link SceneStatusListener}.
62 * @return the scene listener id
64 String getSceneStatusListenerID();