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 org.tellstick.device.iface.Device;
16 import org.tellstick.enums.DeviceType;
18 import com.google.gson.annotations.SerializedName;
21 * Class used to deserialize JSON from Telldus local API.
23 * @author Jan Gustafsson - Initial contribution
25 public class TellstickLocalDeviceDTO implements Device {
32 private String statevalue;
34 private String protocol;
36 private boolean updated;
38 public void setUpdated(boolean b) {
42 public boolean isUpdated() {
51 public void setId(int deviceId) {
52 this.deviceId = deviceId;
55 public int getMethods() {
59 public void setMethods(int methods) {
60 this.methods = methods;
64 public String getName() {
68 public void setName(String name) {
73 public String getUUId() {
74 return Integer.toString(deviceId);
78 public String getProtocol() {
83 public String getModel() {
88 public DeviceType getDeviceType() {
89 return DeviceType.DEVICE;
92 public int getState() {
96 public void setState(int state) {
100 public String getStatevalue() {
104 public void setStatevalue(String statevalue) {
105 this.statevalue = statevalue;
108 public String getType() {
112 public void setType(String type) {
117 public boolean equals(Object obj) {
118 // used to test if device exist
122 if (!(obj instanceof TellstickLocalDeviceDTO other)) {
125 return deviceId == other.deviceId;
129 public int hashCode() {