]> git.basschouten.com Git - openhab-addons.git/blob
b004c530185fcaf332061e9c9cd2df0d3f8bb0aa
[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.tellstick.internal.handler;
14
15 import org.openhab.core.thing.Bridge;
16 import org.tellstick.device.iface.Device;
17 import org.tellstick.device.iface.TellstickEvent;
18
19 /**
20  * The {@link DeviceStatusListener} is notified when a device status has changed
21  * or a device has been removed or added.
22  *
23  * @author Jarle Hjortland - Initial contribution
24  */
25 public interface DeviceStatusListener {
26
27     /**
28      * This method is called whenever the state of the given device has changed.
29      * The new state can be obtained by {@link FullLight#getState()}.
30      *
31      * @param bridge
32      *            The Tellstick bridge the changed device is connected to.
33      * @param device
34      *            The device which received the state update.
35      */
36     void onDeviceStateChanged(Bridge bridge, Device device, TellstickEvent deviceEvent);
37
38     /**
39      * This method us called whenever a device is removed.
40      *
41      * @param bridge
42      *            The Tellstick bridge the removed device was connected to.
43      * @param device
44      *            The device which is removed.
45      */
46     void onDeviceRemoved(Bridge bridge, Device device);
47
48     /**
49      * This method us called whenever a device is added.
50      *
51      * @param bridge
52      *            The Tellstick bridge the added device was connected to.
53      * @param device
54      *            The device which is added.
55      */
56     void onDeviceAdded(Bridge bridge, Device device);
57 }