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.sensebox.internal.dto;
15 import com.google.gson.annotations.SerializedName;
18 * The {@link SenseBoxSensor} holds a de-serialized representation
19 * of the API response and the data therein...
21 * @author Hakan Tandogan - Initial contribution
23 public class SenseBoxSensor {
25 @SerializedName("_id")
28 @SerializedName("title")
31 @SerializedName("unit")
34 @SerializedName("icon")
37 @SerializedName("sensorType")
38 private String sensorType;
40 @SerializedName("lastMeasurement")
41 private SenseBoxMeasurement lastMeasurement;
43 public String getId() {
47 public void setId(String id) {
51 public String getTitle() {
55 public void setTitle(String title) {
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") : "";
65 public void setUnit(String unit) {
69 public String getIcon() {
73 public void setIcon(String icon) {
77 public String getSensorType() {
81 public void setSensorType(String sensorType) {
82 this.sensorType = sensorType;
85 public SenseBoxMeasurement getLastMeasurement() {
86 return lastMeasurement;
89 public void setLastMeasurement(SenseBoxMeasurement lastMeasurement) {
90 this.lastMeasurement = lastMeasurement;