]> git.basschouten.com Git - openhab-addons.git/blob
6116d7585ad1c93d026cbcaa75ffa3f9752a7497
[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.digitalstrom.internal.lib.listener;
14
15 import org.openhab.binding.digitalstrom.internal.lib.structure.scene.InternalScene;
16
17 /**
18  * The {@link SceneStatusListener} is notified, if an {@link InternalScene} status has changed or a
19  * {@link InternalScene} has been removed or added.
20  *
21  * <p>
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 org.openhab.binding.digitalstrom.internal.lib.manager.SceneManager#registerSceneListener(SceneStatusListener)}.
26  * Then the {@link SceneStatusListener} gets informed by the methods {@link #onSceneAdded(InternalScene)} and
27  * {@link #onSceneRemoved(InternalScene)}.
28  *
29  * @author Michael Ochel - Initial contribution
30  * @author Matthias Siegele - Initial contribution
31  */
32 public interface SceneStatusListener {
33
34     /**
35      * The {@link SceneStatusListener} id for the discovery implementation.
36      */
37     static final String SCENE_DISCOVERY = "SceneDiscovery";
38
39     /**
40      * This method is called whenever the state of the {@link InternalScene} has changed.
41      *
42      * @param newState (true = call | false = undo)
43      */
44     void onSceneStateChanged(boolean newState);
45
46     /**
47      * This method is called whenever an {@link InternalScene} is removed.
48      *
49      * @param scene that was removed
50      */
51     void onSceneRemoved(InternalScene scene);
52
53     /**
54      * This method is called whenever an {@link InternalScene} is added.
55      *
56      * @param scene that was added
57      */
58     void onSceneAdded(InternalScene scene);
59
60     /**
61      * Return the id of this {@link SceneStatusListener}.
62      *
63      * @return the scene listener id
64      */
65     String getSceneStatusListenerID();
66 }