]> git.basschouten.com Git - openhab-addons.git/blob
f55aa97e3ee22ded7b4fd5a29a74069c6cbf5850
[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 TellstickNetDevice#getState()} /
30      * {@link TellstickLocalDeviceDTO#getState()}.
31      *
32      * @param bridge
33      *            The Tellstick bridge the changed device is connected to.
34      * @param device
35      *            The device which received the state update.
36      */
37     void onDeviceStateChanged(Bridge bridge, Device device, TellstickEvent deviceEvent);
38
39     /**
40      * This method us called whenever a device is removed.
41      *
42      * @param bridge
43      *            The Tellstick bridge the removed device was connected to.
44      * @param device
45      *            The device which is removed.
46      */
47     void onDeviceRemoved(Bridge bridge, Device device);
48
49     /**
50      * This method us called whenever a device is added.
51      *
52      * @param bridge
53      *            The Tellstick bridge the added device was connected to.
54      * @param device
55      *            The device which is added.
56      */
57     void onDeviceAdded(Bridge bridge, Device device);
58 }