]> git.basschouten.com Git - openhab-addons.git/blob
bcdaad913f9bbfed9814b22183832e3a55a0b886
[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.hue.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.hue.internal.dto.FullLight;
17
18 /**
19  * The {@link LightStatusListener} is notified when a light status has changed or a light has been removed or added.
20  *
21  * @author Oliver Libutzki - Initial contribution
22  * @author Denis Dudnik - switched to internally integrated source of Jue library, minor code cleanup
23  */
24 @NonNullByDefault
25 public interface LightStatusListener {
26
27     /**
28      * This method returns the light id of the listener
29      * 
30      * @return
31      */
32     String getLightId();
33
34     /**
35      * This method is called whenever the state of the given light has changed. The new state can be obtained by
36      * {@link FullLight#getState()}.
37      *
38      * @param light The light which received the state update.
39      * @return
40      */
41     boolean onLightStateChanged(FullLight light);
42
43     /**
44      * This method is called whenever a light is removed.
45      */
46     void onLightRemoved();
47
48     /**
49      * This method is called whenever a light is reported as gone.
50      */
51     void onLightGone();
52
53     /**
54      * This method is called whenever a light is added.
55      *
56      * @param light The light which is added.
57      */
58     void onLightAdded(FullLight light);
59
60     /**
61      * The thing will block state updates for set time.
62      * 
63      * @param bypassTime
64      */
65     void setPollBypass(long bypassTime);
66
67     /**
68      * Unblock state updates.
69      */
70     void unsetPollBypass();
71 }