2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.structure.devices;
15 import java.util.List;
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;
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.
27 * @author Michael Ochel - initial contributer
28 * @author Matthias Siegele - initial contributer
30 public interface Circuit extends GeneralDeviceInformation {
33 * Returns the hardware version of this {@link Circuit} as {@link Integer}.
35 * @return hardware version
37 Integer getHwVersion();
40 * Sets the hardware version of this {@link Circuit} as {@link Integer}.
42 * @param hwVersion the new hardware version as {@link Integer}
44 void setHwVersion(Integer hwVersion);
47 * Returns the hardware version of this {@link Circuit} as {@link String}.
49 * @return hardware version
51 String getHwVersionString();
54 * Sets the hardware version of this {@link Circuit} as {@link String}.
56 * @param hwVersionString the new hardware version as {@link Integer}
58 void setHwVersionString(String hwVersionString);
61 * Returns the software version of this {@link Circuit} as {@link String}.
63 * @return the software version
65 String getSwVersion();
68 * Sets the software version of this {@link Circuit} as {@link String}.
70 * @param swVersion the new software version
72 void setSwVersion(String swVersion);
75 * Returns the arm software version of this {@link Circuit} as {@link Integer}.
77 * @return the arm software version
79 Integer getArmSwVersion();
82 * Sets the arm software version of this {@link Circuit} as {@link Integer}.
84 * @param armSwVersion the new arm software version
86 void setArmSwVersion(Integer armSwVersion);
89 * Returns the dsp software version of this {@link Circuit} as {@link Integer}.
91 * @return the dsp softwaree version
93 Integer getDspSwVersion();
96 * Sets the dsp software version of this {@link Circuit} as {@link Integer}.
98 * @param dspSwVersion the new dsp software version
100 void setDspSwVersion(Integer dspSwVersion);
103 * Returns the api version of this {@link Circuit} as {@link Integer}.
105 * @return the api version as {@link Integer}
107 Integer getApiVersion();
110 * Setss the api version of this {@link Circuit} as {@link Integer}.
112 * @param apiVersion the new api version
114 void setApiVersion(Integer apiVersion);
117 * Returns the hardware name of this {@link Circuit}.
119 * @return the hardware name
124 * Sets the hardware name of this {@link Circuit}.
126 * @param hwName the new hardware name
128 void setHwName(String hwName);
131 * Returns the bus member type of this {@link Circuit} as {@link Integer}.
133 * @return the bus member type
135 Integer getBusMemberType();
138 * Sets the bus member type of this {@link Circuit} as {@link Integer}.
140 * @param busMemberType the new bus member type
142 void setBusMemberType(Integer busMemberType);
145 * Returns true, if this {@link Circuit} has connected {@link Device}'s, otherwise false.
147 * @return true, if {@link Device}'s are connected
149 Boolean getHasDevices();
152 * Sets the connected devices flag.
154 * @param hasDevices the new connected devices flag
156 void setHasDevices(Boolean hasDevices);
159 * Returns true, if this {@link Circuit} is valid to metering power data, otherwise false.
161 * @return true, if is valid to metering power data
163 Boolean getHasMetering();
166 * Sets the flag hasMetering.
168 * @param hasMetering the new hasMetering flag.
170 void setHasMetering(Boolean hasMetering);
173 * Returns the vdc configuration URL of this {@link Circuit} as {@link String}.
175 * @return the vdc configuration URL
177 String getVdcConfigURL();
180 * Sets the vdc configuration URL of this {@link Circuit} as {@link String}.
182 * @param vdcConfigURL the new vdc configuration URL
184 void setVdcConfigURL(String vdcConfigURL);
187 * Returns the vdc mode UID of this {@link Circuit} as {@link String}.
189 * @return the vdc mode UID
191 String getVdcModelUID();
194 * Sets the vdc mode UID of this {@link Circuit} as {@link String}.
196 * @param vdcModelUID the new vdc mode UID
198 void setVdcModelUID(String vdcModelUID);
201 * Returns the vdc hardware GUID of this {@link Circuit} as {@link String}.
203 * @return the vdc hardware GUID
205 String getVdcHardwareGuid();
208 * Sets the vdc hardware GUID of this {@link Circuit} as {@link String}.
210 * @param vdcHardwareGuid the new vdc hardware GUID
212 void setVdcHardwareGuid(String vdcHardwareGuid);
215 * Returns the vdc hardware model GUID of this {@link Circuit} as {@link String}.
217 * @return the vdc hardware mode GUID
219 String getVdcHardwareModelGuid();
222 * Sets the vdc hardware model GUID of this {@link Circuit} as {@link String}.
224 * @param vdcHardwareModelGuid the new vdc model GUID
226 void setVdcHardwareModelGuid(String vdcHardwareModelGuid);
229 * Returns the vdc vendor GUID of this {@link Circuit} as {@link String}.
231 * @return the vdc vendor GUID
233 String getVdcVendorGuid();
236 * Sets the vdc vendor GUID of this {@link Circuit} as {@link String}.
238 * @param vdcVendorGuid the new vdc vendor GUID
240 void setVdcVendorGuid(String vdcVendorGuid);
243 * Returns the vdc oem GUID of this {@link Circuit} as {@link String}.
245 * @return the vdc oem GUID
247 String getVdcOemGuid();
250 * Sets the vdc oem GUID of this {@link Circuit} as {@link String}.
252 * @param vdcOemGuid the new vdc oem GUID
254 void setVdcOemGuid(String vdcOemGuid);
257 * Returns true, if actions from new {@link Device}'s will be ignored by this {@link Circuit}, otherwise false.
259 * @return true, if actions form new device will be ignored
261 Boolean getIgnoreActionsFromNewDevices();
264 * Sets the flag for ignore actions from new {@link Device}'s.
266 * @param ignoreActionsFromNewDevices the new ignore actions from new devices flag
268 void setIgnoreActionsFromNewDevices(Boolean ignoreActionsFromNewDevices);
271 * Adds a new {@link CachedMeteringValue} or update the existing, if the new one is newer.
273 * @param cachedMeteringValue the new {@link CachedMeteringValue}
275 void addMeteringValue(CachedMeteringValue cachedMeteringValue);
278 * Returns the value of the given {@link CachedMeteringValue} through the {@link MeteringTypeEnum} and
279 * {@link MeteringUnitsEnum}.
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
285 double getMeteringValue(MeteringTypeEnum meteringType, MeteringUnitsEnum meteringUnit);
288 * Returns the {@link List} of all {@link CachedMeteringValue}'s.
290 * @return list of all {@link CachedMeteringValue}
292 List<CachedMeteringValue> getAllCachedMeteringValues();