]> git.basschouten.com Git - openhab-addons.git/blob
ba66ddf80d85cf14dafef174b4b3ad132dc45958
[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.structure.devices;
14
15 import org.openhab.binding.digitalstrom.internal.lib.listener.DeviceStatusListener;
16 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
17
18 /**
19  * The {@link GeneralDeviceInformation} interface contains all informations of digitalSTROM devices, which are
20  * identical for all device types. It also contains the methods to implement the mechanism of the
21  * {@link DeviceStatusListener}.
22  *
23  * @author Michael Ochel - Initial contribution
24  * @author Matthias Siegele - Initial contribution
25  */
26 public interface GeneralDeviceInformation {
27
28     /**
29      * Returns the user defined name of this device.
30      *
31      * @return name of this device
32      */
33     String getName();
34
35     /**
36      * Sets the name of this device;
37      *
38      * @param name to set
39      */
40     void setName(String name);
41
42     /**
43      * Returns the dSID of this device.
44      *
45      * @return {@link DSID} dSID
46      */
47     DSID getDSID();
48
49     /**
50      * Returns the dSUID of this device.
51      *
52      * @return dSID
53      */
54     String getDSUID();
55
56     /**
57      * This device is available in his zone or not.
58      * Every 24h the dSM (meter) checks, if the devices are
59      * plugged in
60      *
61      * @return true, if device is available otherwise false
62      */
63     Boolean isPresent();
64
65     /**
66      * Sets this device is available in his zone or not.
67      *
68      * @param isPresent (true = available | false = not available)
69      */
70     void setIsPresent(boolean isPresent);
71
72     /**
73      * Register a {@link DeviceStatusListener} to this {@link Device}.
74      *
75      * @param deviceStatuslistener to register
76      */
77     void registerDeviceStatusListener(DeviceStatusListener deviceStatuslistener);
78
79     /**
80      * Unregister the {@link DeviceStatusListener} to this {@link Device} if it exists.
81      *
82      * @return the unregistered {@link DeviceStatusListener} or null if no one was registered
83      */
84     DeviceStatusListener unregisterDeviceStatusListener();
85
86     /**
87      * Returns true, if a {@link DeviceStatusListener} is registered to this {@link Device}, otherwise false.
88      *
89      * @return return true, if a lister is registered, otherwise false
90      */
91     boolean isListenerRegisterd();
92
93     /**
94      * Returns true, if this device is valid, otherwise false.
95      *
96      * @return true, if valid
97      */
98     Boolean isValid();
99
100     /**
101      * Sets the valid state.
102      *
103      * @param isValid the new valid state
104      */
105     void setIsValid(boolean isValid);
106
107     /**
108      * Returns the in the digitalSTROM web interface displayed dSID.
109      *
110      * @return displayed dSID
111      */
112     String getDisplayID();
113
114     /**
115      * Returns the registered {@link DeviceStatusListener} or null, if no {@link DeviceStatusListener} is registered
116      *
117      * @return the registered {@link DeviceStatusListener} or null
118      */
119     DeviceStatusListener getDeviceStatusListener();
120 }