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 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.
28 * @author Michael Ochel - Initial contribution
29 * @author Matthias Siegele - Initial contribution
31 public interface Circuit extends GeneralDeviceInformation {
34 * Returns the hardware version of this {@link Circuit} as {@link Integer}.
36 * @return hardware version
38 Integer getHwVersion();
41 * Sets the hardware version of this {@link Circuit} as {@link Integer}.
43 * @param hwVersion the new hardware version as {@link Integer}
45 void setHwVersion(Integer hwVersion);
48 * Returns the hardware version of this {@link Circuit} as {@link String}.
50 * @return hardware version
52 String getHwVersionString();
55 * Sets the hardware version of this {@link Circuit} as {@link String}.
57 * @param hwVersionString the new hardware version as {@link Integer}
59 void setHwVersionString(String hwVersionString);
62 * Returns the software version of this {@link Circuit} as {@link String}.
64 * @return the software version
66 String getSwVersion();
69 * Sets the software version of this {@link Circuit} as {@link String}.
71 * @param swVersion the new software version
73 void setSwVersion(String swVersion);
76 * Returns the arm software version of this {@link Circuit} as {@link Integer}.
78 * @return the arm software version
80 Integer getArmSwVersion();
83 * Sets the arm software version of this {@link Circuit} as {@link Integer}.
85 * @param armSwVersion the new arm software version
87 void setArmSwVersion(Integer armSwVersion);
90 * Returns the dsp software version of this {@link Circuit} as {@link Integer}.
92 * @return the dsp softwaree version
94 Integer getDspSwVersion();
97 * Sets the dsp software version of this {@link Circuit} as {@link Integer}.
99 * @param dspSwVersion the new dsp software version
101 void setDspSwVersion(Integer dspSwVersion);
104 * Returns the api version of this {@link Circuit} as {@link Integer}.
106 * @return the api version as {@link Integer}
108 Integer getApiVersion();
111 * Setss the api version of this {@link Circuit} as {@link Integer}.
113 * @param apiVersion the new api version
115 void setApiVersion(Integer apiVersion);
118 * Returns the hardware name of this {@link Circuit}.
120 * @return the hardware name
125 * Sets the hardware name of this {@link Circuit}.
127 * @param hwName the new hardware name
129 void setHwName(String hwName);
132 * Returns the bus member type of this {@link Circuit} as {@link Integer}.
134 * @return the bus member type
136 Integer getBusMemberType();
139 * Sets the bus member type of this {@link Circuit} as {@link Integer}.
141 * @param busMemberType the new bus member type
143 void setBusMemberType(Integer busMemberType);
146 * Returns true, if this {@link Circuit} has connected {@link Device}'s, otherwise false.
148 * @return true, if {@link Device}'s are connected
150 Boolean getHasDevices();
153 * Sets the connected devices flag.
155 * @param hasDevices the new connected devices flag
157 void setHasDevices(Boolean hasDevices);
160 * Returns true, if this {@link Circuit} is valid to metering power data, otherwise false.
162 * @return true, if is valid to metering power data
164 Boolean getHasMetering();
167 * Sets the flag hasMetering.
169 * @param hasMetering the new hasMetering flag.
171 void setHasMetering(Boolean hasMetering);
174 * Returns the vdc configuration URL of this {@link Circuit} as {@link String}.
176 * @return the vdc configuration URL
178 String getVdcConfigURL();
181 * Sets the vdc configuration URL of this {@link Circuit} as {@link String}.
183 * @param vdcConfigURL the new vdc configuration URL
185 void setVdcConfigURL(String vdcConfigURL);
188 * Returns the vdc mode UID of this {@link Circuit} as {@link String}.
190 * @return the vdc mode UID
192 String getVdcModelUID();
195 * Sets the vdc mode UID of this {@link Circuit} as {@link String}.
197 * @param vdcModelUID the new vdc mode UID
199 void setVdcModelUID(String vdcModelUID);
202 * Returns the vdc hardware GUID of this {@link Circuit} as {@link String}.
204 * @return the vdc hardware GUID
206 String getVdcHardwareGuid();
209 * Sets the vdc hardware GUID of this {@link Circuit} as {@link String}.
211 * @param vdcHardwareGuid the new vdc hardware GUID
213 void setVdcHardwareGuid(String vdcHardwareGuid);
216 * Returns the vdc hardware model GUID of this {@link Circuit} as {@link String}.
218 * @return the vdc hardware mode GUID
220 String getVdcHardwareModelGuid();
223 * Sets the vdc hardware model GUID of this {@link Circuit} as {@link String}.
225 * @param vdcHardwareModelGuid the new vdc model GUID
227 void setVdcHardwareModelGuid(String vdcHardwareModelGuid);
230 * Returns the vdc vendor GUID of this {@link Circuit} as {@link String}.
232 * @return the vdc vendor GUID
234 String getVdcVendorGuid();
237 * Sets the vdc vendor GUID of this {@link Circuit} as {@link String}.
239 * @param vdcVendorGuid the new vdc vendor GUID
241 void setVdcVendorGuid(String vdcVendorGuid);
244 * Returns the vdc oem GUID of this {@link Circuit} as {@link String}.
246 * @return the vdc oem GUID
248 String getVdcOemGuid();
251 * Sets the vdc oem GUID of this {@link Circuit} as {@link String}.
253 * @param vdcOemGuid the new vdc oem GUID
255 void setVdcOemGuid(String vdcOemGuid);
258 * Returns true, if actions from new {@link Device}'s will be ignored by this {@link Circuit}, otherwise false.
260 * @return true, if actions form new device will be ignored
262 Boolean getIgnoreActionsFromNewDevices();
265 * Sets the flag for ignore actions from new {@link Device}'s.
267 * @param ignoreActionsFromNewDevices the new ignore actions from new devices flag
269 void setIgnoreActionsFromNewDevices(Boolean ignoreActionsFromNewDevices);
272 * Adds a new {@link CachedMeteringValue} or update the existing, if the new one is newer.
274 * @param cachedMeteringValue the new {@link CachedMeteringValue}
276 void addMeteringValue(CachedMeteringValue cachedMeteringValue);
279 * Returns the value of the given {@link CachedMeteringValue} through the {@link MeteringTypeEnum} and
280 * {@link MeteringUnitsEnum}.
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
286 double getMeteringValue(MeteringTypeEnum meteringType, MeteringUnitsEnum meteringUnit);
289 * Returns the {@link List} of all {@link CachedMeteringValue}'s.
291 * @return list of all {@link CachedMeteringValue}
293 List<CachedMeteringValue> getAllCachedMeteringValues();