]> git.basschouten.com Git - openhab-addons.git/blob
c62ece2c5978b9d065900fcb7e1e47936c25ff69
[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.sensebox.internal.dto;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link SenseBoxSensor} holds a de-serialized representation
19  * of the API response and the data therein...
20  *
21  * @author Hakan Tandogan - Initial contribution
22  */
23 public class SenseBoxSensor {
24
25     @SerializedName("_id")
26     private String id;
27
28     @SerializedName("title")
29     private String title;
30
31     @SerializedName("unit")
32     private String unit;
33
34     @SerializedName("icon")
35     private String icon;
36
37     @SerializedName("sensorType")
38     private String sensorType;
39
40     @SerializedName("lastMeasurement")
41     private SenseBoxMeasurement lastMeasurement;
42
43     public String getId() {
44         return id;
45     }
46
47     public void setId(String id) {
48         this.id = id;
49     }
50
51     public String getTitle() {
52         return title;
53     }
54
55     public void setTitle(String title) {
56         this.title = title;
57     }
58
59     public String getUnit() {
60         // the uom library uses the 'MICRO SIGN', so if we encounter the GREEK SMALL LETTER MU,
61         // replace it with the proper representation.
62         return unit != null ? unit.replace("\u03bc", "\u00b5") : "";
63     }
64
65     public void setUnit(String unit) {
66         this.unit = unit;
67     }
68
69     public String getIcon() {
70         return icon;
71     }
72
73     public void setIcon(String icon) {
74         this.icon = icon;
75     }
76
77     public String getSensorType() {
78         return sensorType;
79     }
80
81     public void setSensorType(String sensorType) {
82         this.sensorType = sensorType;
83     }
84
85     public SenseBoxMeasurement getLastMeasurement() {
86         return lastMeasurement;
87     }
88
89     public void setLastMeasurement(SenseBoxMeasurement lastMeasurement) {
90         this.lastMeasurement = lastMeasurement;
91     }
92 }