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