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.livisismarthome.internal.client.api.entity.device;
15 import org.openhab.binding.livisismarthome.internal.client.api.entity.state.BooleanStateDTO;
16 import org.openhab.binding.livisismarthome.internal.client.api.entity.state.DateTimeStateDTO;
17 import org.openhab.binding.livisismarthome.internal.client.api.entity.state.DoubleStateDTO;
18 import org.openhab.binding.livisismarthome.internal.client.api.entity.state.IntegerStateDTO;
19 import org.openhab.binding.livisismarthome.internal.client.api.entity.state.StringStateDTO;
21 import com.google.gson.annotations.SerializedName;
24 * Holds the state of the Device.
26 * @author Oliver Kuhl - Initial contribution
29 public class StateDTO {
30 /** Standard device states */
31 @SerializedName("deviceInclusionState")
32 private StringStateDTO deviceInclusionState;
33 @SerializedName("deviceConfigurationState")
34 private StringStateDTO deviceConfigurationState;
35 private BooleanStateDTO isReachable;
36 private StringStateDTO updateState;
37 private StringStateDTO firmwareVersion;
38 @SerializedName("WHRating")
39 private DoubleStateDTO wHRating;
41 /** SHC device states */
42 // Removed updateAvailable because it is different between version 1 and 2 devices and not used anyway
43 // Related to openhab-addons #6613
44 // private StringState updateAvailable
45 private DateTimeStateDTO lastReboot;
46 private DoubleStateDTO memoryLoad;
47 @SerializedName("CPULoad")
48 private DoubleStateDTO cpuLoad;
49 @SerializedName("LBDongleAttached")
50 private BooleanStateDTO lBDongleAttached;
51 @SerializedName("MBusDongleAttached")
52 private BooleanStateDTO mBusDongleAttached;
53 private IntegerStateDTO configVersion;
54 @SerializedName("OSState")
55 private StringStateDTO osState;
56 private IntegerStateDTO wifiSignalStrength;
57 private StringStateDTO ethIpAddress;
58 private StringStateDTO wifiIpAddress;
59 private StringStateDTO ethMacAddress;
60 private StringStateDTO wifiMacAddress;
61 private StringStateDTO inUseAdapter;
62 private BooleanStateDTO discoveryActive;
63 private StringStateDTO operationStatus;
64 private DoubleStateDTO currentUtcOffset;
65 private DoubleStateDTO cpuUsage;
66 private DoubleStateDTO diskUsage;
67 private DoubleStateDTO memoryUsage;
70 deviceInclusionState = new StringStateDTO();
71 deviceConfigurationState = new StringStateDTO();
72 isReachable = new BooleanStateDTO();
73 updateState = new StringStateDTO();
74 firmwareVersion = new StringStateDTO();
75 wHRating = new DoubleStateDTO();
76 lastReboot = new DateTimeStateDTO();
77 memoryLoad = new DoubleStateDTO();
78 cpuLoad = new DoubleStateDTO();
79 lBDongleAttached = new BooleanStateDTO();
80 mBusDongleAttached = new BooleanStateDTO();
81 configVersion = new IntegerStateDTO();
82 osState = new StringStateDTO();
83 wifiSignalStrength = new IntegerStateDTO();
84 ethIpAddress = new StringStateDTO();
85 wifiIpAddress = new StringStateDTO();
86 ethMacAddress = new StringStateDTO();
87 wifiMacAddress = new StringStateDTO();
88 inUseAdapter = new StringStateDTO();
89 discoveryActive = new BooleanStateDTO();
90 operationStatus = new StringStateDTO();
91 currentUtcOffset = new DoubleStateDTO();
92 cpuUsage = new DoubleStateDTO();
93 diskUsage = new DoubleStateDTO();
94 memoryUsage = new DoubleStateDTO();
98 * @return the deviceInclusionState
100 public StringStateDTO getDeviceInclusionState() {
101 return deviceInclusionState;
105 * @param deviceInclusionState the deviceInclusionState to set
107 public void setDeviceInclusionState(StringStateDTO deviceInclusionState) {
108 this.deviceInclusionState = deviceInclusionState;
112 * @return the deviceConfigurationState
114 public StringStateDTO getDeviceConfigurationState() {
115 return deviceConfigurationState;
119 * @param deviceConfigurationState the deviceConfigurationState to set
121 public void setDeviceConfigurationState(StringStateDTO deviceConfigurationState) {
122 this.deviceConfigurationState = deviceConfigurationState;
126 * @return the isReachable
128 public BooleanStateDTO getIsReachable() {
133 * @param isReachable the isReachable to set
135 public void setIsReachable(BooleanStateDTO isReachable) {
136 this.isReachable = isReachable;
140 * @return the updateState
142 public StringStateDTO getUpdateState() {
147 * @param updateState the updateState to set
149 public void setUpdateState(StringStateDTO updateState) {
150 this.updateState = updateState;
154 * @return the firmwareVersion
156 public StringStateDTO getFirmwareVersion() {
157 return firmwareVersion;
161 * @param firmwareVersion the firmwareVersion to set
163 public void setFirmwareVersion(StringStateDTO firmwareVersion) {
164 this.firmwareVersion = firmwareVersion;
168 * @return the wHRating
170 public DoubleStateDTO getWHRating() {
175 * @param wHRating the wHRating to set
177 public void setWHRating(DoubleStateDTO wHRating) {
178 this.wHRating = wHRating;
182 * @return the lastReboot
184 public DateTimeStateDTO getLastReboot() {
189 * @param lastReboot the lastReboot to set
191 public void setLastReboot(DateTimeStateDTO lastReboot) {
192 this.lastReboot = lastReboot;
196 * @return the memoryLoad
198 public DoubleStateDTO getMemoryLoad() {
203 * @param memoryLoad the memoryLoad to set
205 public void setMemoryLoad(DoubleStateDTO memoryLoad) {
206 this.memoryLoad = memoryLoad;
210 * @return the cPULoad
212 public DoubleStateDTO getCPULoad() {
217 * @param cpuLoad the cPULoad to set
219 public void setCPULoad(DoubleStateDTO cpuLoad) {
220 this.cpuLoad = cpuLoad;
224 * @return the lBDongleAttached
226 public BooleanStateDTO getLBDongleAttached() {
227 return lBDongleAttached;
231 * @param lBDongleAttached the lBDongleAttached to set
233 public void setLBDongleAttached(BooleanStateDTO lBDongleAttached) {
234 this.lBDongleAttached = lBDongleAttached;
238 * @return the mBusDongleAttached
240 public BooleanStateDTO getMBusDongleAttached() {
241 return mBusDongleAttached;
245 * @param mBusDongleAttached the mBusDongleAttached to set
247 public void setMBusDongleAttached(BooleanStateDTO mBusDongleAttached) {
248 this.mBusDongleAttached = mBusDongleAttached;
252 * @return the configVersion
254 public IntegerStateDTO getConfigVersion() {
255 return configVersion;
259 * @param configVersion the configVersion to set
261 public void setConfigVersion(IntegerStateDTO configVersion) {
262 this.configVersion = configVersion;
266 * @return the oSState
268 public StringStateDTO getOSState() {
273 * @param osState the oSState to set
275 public void setOSState(StringStateDTO osState) {
276 this.osState = osState;
280 * @return the wifiSignalStrength
282 public IntegerStateDTO getWifiSignalStrength() {
283 return wifiSignalStrength;
287 * @param wifiSignalStrength the wifiSignalStrength to set
289 public void setWifiSignalStrength(IntegerStateDTO wifiSignalStrength) {
290 this.wifiSignalStrength = wifiSignalStrength;
294 * @return the ethIpAddress
296 public StringStateDTO getEthIpAddress() {
301 * @param ethIpAddress the ethIpAddress to set
303 public void setEthIpAddress(StringStateDTO ethIpAddress) {
304 this.ethIpAddress = ethIpAddress;
308 * @return the wifiIpAddress
310 public StringStateDTO getWifiIpAddress() {
311 return wifiIpAddress;
315 * @param wifiIpAddress the wifiIpAddress to set
317 public void setWifiIpAddress(StringStateDTO wifiIpAddress) {
318 this.wifiIpAddress = wifiIpAddress;
322 * @return the ethMacAddress
324 public StringStateDTO getEthMacAddress() {
325 return ethMacAddress;
329 * @param ethMacAddress the ethMacAddress to set
331 public void setEthMacAddress(StringStateDTO ethMacAddress) {
332 this.ethMacAddress = ethMacAddress;
336 * @return the wifiMacAddress
338 public StringStateDTO getWifiMacAddress() {
339 return wifiMacAddress;
343 * @param wifiMacAddress the wifiMacAddress to set
345 public void setWifiMacAddress(StringStateDTO wifiMacAddress) {
346 this.wifiMacAddress = wifiMacAddress;
350 * @return the inUseAdapter
352 public StringStateDTO getInUseAdapter() {
357 * @param inUseAdapter the inUseAdapter to set
359 public void setInUseAdapter(StringStateDTO inUseAdapter) {
360 this.inUseAdapter = inUseAdapter;
364 * @return the discoveryActive
366 public BooleanStateDTO getDiscoveryActive() {
367 return discoveryActive;
371 * @param discoveryActive the discoveryActive to set
373 public void setDiscoveryActive(BooleanStateDTO discoveryActive) {
374 this.discoveryActive = discoveryActive;
378 * @return the operationStatus
380 public StringStateDTO getOperationStatus() {
381 return operationStatus;
385 * @param operationStatus the operationStatus to set
387 public void setOperationStatus(StringStateDTO operationStatus) {
388 this.operationStatus = operationStatus;
392 * @return the operationStatus
394 public StringStateDTO getOperationStatus(boolean isSHCClassic) {
398 return getOperationStatus();
402 * @return the currentUtcOffset
404 public DoubleStateDTO getCurrentUtcOffset() {
405 return currentUtcOffset;
409 * @param currentUtcOffset the currentUtcOffset to set
411 public void setCurrentUtcOffset(DoubleStateDTO currentUtcOffset) {
412 this.currentUtcOffset = currentUtcOffset;
416 * @return the cpuUsage
418 public DoubleStateDTO getCpuUsage() {
423 * @param cpuUsage the cpuUsage to set
425 public void setCpuUsage(DoubleStateDTO cpuUsage) {
426 this.cpuUsage = cpuUsage;
429 public DoubleStateDTO getCpuUsage(boolean isSHCClassic) {
433 return getCpuUsage();
437 * @return the diskUsage
439 public DoubleStateDTO getDiskUsage() {
444 * @param diskUsage the diskUsage to set
446 public void setDiskUsage(DoubleStateDTO diskUsage) {
447 this.diskUsage = diskUsage;
451 * @return the memoryUsage
453 public DoubleStateDTO getMemoryUsage() {
458 * @param memoryUsage the memoryUsage to set
460 public void setMemoryUsage(DoubleStateDTO memoryUsage) {
461 this.memoryUsage = memoryUsage;
465 * @return the memoryUsage
467 public DoubleStateDTO getMemoryUsage(boolean isSHCClassic) {
469 return getMemoryLoad();
471 return getMemoryUsage();