]> git.basschouten.com Git - openhab-addons.git/blob
6402faa9b9d05c87ab132a712926d02d603eff9b
[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.pilight.internal.dto;
14
15 import java.util.HashMap;
16 import java.util.List;
17 import java.util.Map;
18
19 import com.fasterxml.jackson.annotation.JsonAnySetter;
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21 import com.fasterxml.jackson.annotation.JsonProperty;
22
23 /**
24  * Class describing a device in pilight
25  *
26  * @author Jeroen Idserda - Initial contribution
27  * @author Stefan Röllin - Port to openHAB 2 pilight binding
28  * @author Niklas Dörfler - Port pilight binding to openHAB 3 + add device discovery
29  */
30 @JsonIgnoreProperties(ignoreUnknown = true)
31 public class Device {
32
33     private String uuid;
34
35     private String origin;
36
37     private String timestamp;
38
39     private List<String> protocol;
40
41     private String state;
42
43     private Integer dimlevel = null;
44
45     // @SerializedName("dimlevel-maximum")
46     private Integer dimlevelMaximum = null;
47
48     private Integer dimlevelMinimum = null;
49
50     private List<Map<String, String>> id;
51
52     private Map<String, String> properties = new HashMap<>();
53
54     public String getUuid() {
55         return uuid;
56     }
57
58     public void setUuid(String uuid) {
59         this.uuid = uuid;
60     }
61
62     public String getOrigin() {
63         return origin;
64     }
65
66     public void setOrigin(String origin) {
67         this.origin = origin;
68     }
69
70     public String getTimestamp() {
71         return timestamp;
72     }
73
74     public void setTimestamp(String timestamp) {
75         this.timestamp = timestamp;
76     }
77
78     public List<String> getProtocol() {
79         return protocol;
80     }
81
82     public void setProtocol(List<String> protocol) {
83         this.protocol = protocol;
84     }
85
86     public String getState() {
87         return state;
88     }
89
90     public void setState(String state) {
91         this.state = state;
92     }
93
94     public Integer getDimlevel() {
95         return dimlevel;
96     }
97
98     public void setDimlevel(Integer dimlevel) {
99         this.dimlevel = dimlevel;
100     }
101
102     public Integer getDimlevelMaximum() {
103         return dimlevelMaximum;
104     }
105
106     @JsonProperty("dimlevel-maximum")
107     public void setDimlevelMaximum(Integer dimlevelMaximum) {
108         this.dimlevelMaximum = dimlevelMaximum;
109     }
110
111     public Integer getDimlevelMinimum() {
112         return dimlevelMinimum;
113     }
114
115     @JsonProperty("dimlevel-minimum")
116     public void setDimlevelMinimum(Integer dimlevelMinimum) {
117         this.dimlevelMinimum = dimlevelMinimum;
118     }
119
120     public List<Map<String, String>> getId() {
121         return id;
122     }
123
124     public void setId(List<Map<String, String>> id) {
125         this.id = id;
126     }
127
128     public void setProperties(Map<String, String> properties) {
129         this.properties = properties;
130     }
131
132     public Map<String, String> getProperties() {
133         return properties;
134     }
135
136     @JsonAnySetter
137     public void set(String name, Object value) {
138         properties.put(name, value.toString());
139     }
140 }