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