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.tellstick.internal.local.dto;
15 import java.util.List;
17 import org.openhab.binding.tellstick.internal.live.xml.LiveDataType;
18 import org.tellstick.device.iface.Device;
19 import org.tellstick.enums.DeviceType;
21 import com.google.gson.annotations.SerializedName;
24 * Class used to deserialize JSON from Telldus local API.
26 * @author Jan Gustafsson - Initial contribution
28 public class TellstickLocalSensorDTO implements Device {
31 private boolean updated;
32 private List<LocalDataTypeValueDTO> data = null;
37 private String protocol;
40 public int getBattery() {
44 public void setBattery(int battery) {
45 this.battery = battery;
48 public List<LocalDataTypeValueDTO> getData() {
52 public void setData(List<LocalDataTypeValueDTO> data) {
61 public void setId(int id) {
66 public String getModel() {
70 public void setModel(String model) {
75 public String getName() {
79 public void setName(String name) {
84 public String getProtocol() {
88 public void setProtocol(String protocol) {
89 this.protocol = protocol;
92 public void setUpdated(boolean b) {
96 public boolean isUpdated() {
100 public boolean isSensorOfType(LiveDataType type) {
103 for (LocalDataTypeValueDTO val : data) {
104 if (val.getName() == type) {
114 public DeviceType getDeviceType() {
115 return DeviceType.SENSOR;
118 public int getSensorId() {
122 public void setSensorId(int sensorId) {
123 this.sensorId = sensorId;
127 public String getUUId() {
128 return Integer.toString(deviceId);