]> git.basschouten.com Git - openhab-addons.git/blob
8aa662839b7ac5e45c77e7b1f75e5bca440a3578
[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 java.util.List;
16
17 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.CachedMeteringValue;
18 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringTypeEnum;
19 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.constants.MeteringUnitsEnum;
20
21 /**
22  * The {@link Circuit} represents a circuit of the digitalStrom system. For that all information will be able to get and
23  * set through the same named getter- and setter-methods. To get informed about status and configuration changes a
24  * {@link org.openhab.binding.digitalstrom.internal.lib.listener.DeviceStatusListener} can be registered. For that and
25  * to get the general device informations like the dSID the {@link Circuit} implements the
26  * {@link org.openhab.binding.digitalstrom.internal.lib.structure.devices.GeneralDeviceInformation}s interface.
27  *
28  * @author Michael Ochel - Initial contribution
29  * @author Matthias Siegele - Initial contribution
30  */
31 public interface Circuit extends GeneralDeviceInformation {
32
33     /**
34      * Returns the hardware version of this {@link Circuit} as {@link Integer}.
35      *
36      * @return hardware version
37      */
38     Integer getHwVersion();
39
40     /**
41      * Sets the hardware version of this {@link Circuit} as {@link Integer}.
42      *
43      * @param hwVersion the new hardware version as {@link Integer}
44      */
45     void setHwVersion(Integer hwVersion);
46
47     /**
48      * Returns the hardware version of this {@link Circuit} as {@link String}.
49      *
50      * @return hardware version
51      */
52     String getHwVersionString();
53
54     /**
55      * Sets the hardware version of this {@link Circuit} as {@link String}.
56      *
57      * @param hwVersionString the new hardware version as {@link Integer}
58      */
59     void setHwVersionString(String hwVersionString);
60
61     /**
62      * Returns the software version of this {@link Circuit} as {@link String}.
63      *
64      * @return the software version
65      */
66     String getSwVersion();
67
68     /**
69      * Sets the software version of this {@link Circuit} as {@link String}.
70      *
71      * @param swVersion the new software version
72      */
73     void setSwVersion(String swVersion);
74
75     /**
76      * Returns the arm software version of this {@link Circuit} as {@link Integer}.
77      *
78      * @return the arm software version
79      */
80     Integer getArmSwVersion();
81
82     /**
83      * Sets the arm software version of this {@link Circuit} as {@link Integer}.
84      *
85      * @param armSwVersion the new arm software version
86      */
87     void setArmSwVersion(Integer armSwVersion);
88
89     /**
90      * Returns the dsp software version of this {@link Circuit} as {@link Integer}.
91      *
92      * @return the dsp softwaree version
93      */
94     Integer getDspSwVersion();
95
96     /**
97      * Sets the dsp software version of this {@link Circuit} as {@link Integer}.
98      *
99      * @param dspSwVersion the new dsp software version
100      */
101     void setDspSwVersion(Integer dspSwVersion);
102
103     /**
104      * Returns the api version of this {@link Circuit} as {@link Integer}.
105      *
106      * @return the api version as {@link Integer}
107      */
108     Integer getApiVersion();
109
110     /**
111      * Setss the api version of this {@link Circuit} as {@link Integer}.
112      *
113      * @param apiVersion the new api version
114      */
115     void setApiVersion(Integer apiVersion);
116
117     /**
118      * Returns the hardware name of this {@link Circuit}.
119      *
120      * @return the hardware name
121      */
122     String getHwName();
123
124     /**
125      * Sets the hardware name of this {@link Circuit}.
126      *
127      * @param hwName the new hardware name
128      */
129     void setHwName(String hwName);
130
131     /**
132      * Returns the bus member type of this {@link Circuit} as {@link Integer}.
133      *
134      * @return the bus member type
135      */
136     Integer getBusMemberType();
137
138     /**
139      * Sets the bus member type of this {@link Circuit} as {@link Integer}.
140      *
141      * @param busMemberType the new bus member type
142      */
143     void setBusMemberType(Integer busMemberType);
144
145     /**
146      * Returns true, if this {@link Circuit} has connected {@link Device}'s, otherwise false.
147      *
148      * @return true, if {@link Device}'s are connected
149      */
150     Boolean getHasDevices();
151
152     /**
153      * Sets the connected devices flag.
154      *
155      * @param hasDevices the new connected devices flag
156      */
157     void setHasDevices(Boolean hasDevices);
158
159     /**
160      * Returns true, if this {@link Circuit} is valid to metering power data, otherwise false.
161      *
162      * @return true, if is valid to metering power data
163      */
164     Boolean getHasMetering();
165
166     /**
167      * Sets the flag hasMetering.
168      *
169      * @param hasMetering the new hasMetering flag.
170      */
171     void setHasMetering(Boolean hasMetering);
172
173     /**
174      * Returns the vdc configuration URL of this {@link Circuit} as {@link String}.
175      *
176      * @return the vdc configuration URL
177      */
178     String getVdcConfigURL();
179
180     /**
181      * Sets the vdc configuration URL of this {@link Circuit} as {@link String}.
182      *
183      * @param vdcConfigURL the new vdc configuration URL
184      */
185     void setVdcConfigURL(String vdcConfigURL);
186
187     /**
188      * Returns the vdc mode UID of this {@link Circuit} as {@link String}.
189      *
190      * @return the vdc mode UID
191      */
192     String getVdcModelUID();
193
194     /**
195      * Sets the vdc mode UID of this {@link Circuit} as {@link String}.
196      *
197      * @param vdcModelUID the new vdc mode UID
198      */
199     void setVdcModelUID(String vdcModelUID);
200
201     /**
202      * Returns the vdc hardware GUID of this {@link Circuit} as {@link String}.
203      *
204      * @return the vdc hardware GUID
205      */
206     String getVdcHardwareGuid();
207
208     /**
209      * Sets the vdc hardware GUID of this {@link Circuit} as {@link String}.
210      *
211      * @param vdcHardwareGuid the new vdc hardware GUID
212      */
213     void setVdcHardwareGuid(String vdcHardwareGuid);
214
215     /**
216      * Returns the vdc hardware model GUID of this {@link Circuit} as {@link String}.
217      *
218      * @return the vdc hardware mode GUID
219      */
220     String getVdcHardwareModelGuid();
221
222     /**
223      * Sets the vdc hardware model GUID of this {@link Circuit} as {@link String}.
224      *
225      * @param vdcHardwareModelGuid the new vdc model GUID
226      */
227     void setVdcHardwareModelGuid(String vdcHardwareModelGuid);
228
229     /**
230      * Returns the vdc vendor GUID of this {@link Circuit} as {@link String}.
231      *
232      * @return the vdc vendor GUID
233      */
234     String getVdcVendorGuid();
235
236     /**
237      * Sets the vdc vendor GUID of this {@link Circuit} as {@link String}.
238      *
239      * @param vdcVendorGuid the new vdc vendor GUID
240      */
241     void setVdcVendorGuid(String vdcVendorGuid);
242
243     /**
244      * Returns the vdc oem GUID of this {@link Circuit} as {@link String}.
245      *
246      * @return the vdc oem GUID
247      */
248     String getVdcOemGuid();
249
250     /**
251      * Sets the vdc oem GUID of this {@link Circuit} as {@link String}.
252      *
253      * @param vdcOemGuid the new vdc oem GUID
254      */
255     void setVdcOemGuid(String vdcOemGuid);
256
257     /**
258      * Returns true, if actions from new {@link Device}'s will be ignored by this {@link Circuit}, otherwise false.
259      *
260      * @return true, if actions form new device will be ignored
261      */
262     Boolean getIgnoreActionsFromNewDevices();
263
264     /**
265      * Sets the flag for ignore actions from new {@link Device}'s.
266      *
267      * @param ignoreActionsFromNewDevices the new ignore actions from new devices flag
268      */
269     void setIgnoreActionsFromNewDevices(Boolean ignoreActionsFromNewDevices);
270
271     /**
272      * Adds a new {@link CachedMeteringValue} or update the existing, if the new one is newer.
273      *
274      * @param cachedMeteringValue the new {@link CachedMeteringValue}
275      */
276     void addMeteringValue(CachedMeteringValue cachedMeteringValue);
277
278     /**
279      * Returns the value of the given {@link CachedMeteringValue} through the {@link MeteringTypeEnum} and
280      * {@link MeteringUnitsEnum}.
281      *
282      * @param meteringType (must not be null)
283      * @param meteringUnit (can be null, default is {@link MeteringUnitsEnum#WH})
284      * @return the metering value or -1, if the metering value dose not exist
285      */
286     double getMeteringValue(MeteringTypeEnum meteringType, MeteringUnitsEnum meteringUnit);
287
288     /**
289      * Returns the {@link List} of all {@link CachedMeteringValue}'s.
290      *
291      * @return list of all {@link CachedMeteringValue}
292      */
293     List<CachedMeteringValue> getAllCachedMeteringValues();
294 }