]> git.basschouten.com Git - openhab-addons.git/blob
0dfcbdb0da48952c35ace1b1df85b8dd578d2336
[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.draytonwiser.internal.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * @author Andrew Schofield - Initial contribution
19  */
20 public class DeviceDTO {
21
22     @SerializedName("id")
23     private Integer id;
24     private String productType;
25     private String productIdentifier;
26     private String activeFirmwareVersion;
27     private String manufacturer;
28     private String modelIdentifier;
29     private String hardwareVersion;
30     private String serialNumber;
31     private String productRange;
32     private String productModel;
33     private String productFamily;
34     private String displayedSignalStrength;
35     private Integer batteryVoltage;
36     private String batteryLevel;
37     private Integer rssi;
38     private Integer lqi;
39     private ReceptionDTO receptionOfDevice;
40     private ReceptionDTO receptionOfController;
41     private Boolean deviceLockEnabled;
42
43     public Integer getId() {
44         return id;
45     }
46
47     public String getProductType() {
48         return productType;
49     }
50
51     public String getProductIdentifier() {
52         return productIdentifier;
53     }
54
55     public String getActiveFirmwareVersion() {
56         return activeFirmwareVersion;
57     }
58
59     public String getManufacturer() {
60         return manufacturer;
61     }
62
63     public String getModelIdentifier() {
64         return modelIdentifier;
65     }
66
67     public String getHardwareVersion() {
68         return hardwareVersion;
69     }
70
71     public String getSerialNumber() {
72         return serialNumber;
73     }
74
75     public String getProductRange() {
76         return productRange;
77     }
78
79     public String getProductModel() {
80         return productModel;
81     }
82
83     public String getProductFamily() {
84         return productFamily;
85     }
86
87     public String getDisplayedSignalStrength() {
88         return displayedSignalStrength;
89     }
90
91     public Integer getBatteryVoltage() {
92         return batteryVoltage;
93     }
94
95     public String getBatteryLevel() {
96         return batteryLevel;
97     }
98
99     public Integer getRssi() {
100         if (rssi != null) {
101             return rssi;
102         }
103
104         // JSON response changed with firmware update to include RSSI and LQI on a separate object
105         return receptionOfDevice == null ? null : receptionOfDevice.getRSSI();
106     }
107
108     public Integer getLqi() {
109         if (lqi != null) {
110             return lqi;
111         }
112
113         return receptionOfDevice == null ? null : receptionOfDevice.getLQI();
114     }
115
116     public ReceptionDTO getReceptionOfController() {
117         return receptionOfController;
118     }
119
120     public Boolean getDeviceLockEnabled() {
121         return deviceLockEnabled;
122     }
123 }