]> git.basschouten.com Git - openhab-addons.git/blob
9bfe1bda0e13cc3708bf57673d05914681c1f551
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.avmfritz.internal.dto;
14
15 import java.util.List;
16
17 import javax.xml.bind.annotation.XmlAccessType;
18 import javax.xml.bind.annotation.XmlAccessorType;
19 import javax.xml.bind.annotation.XmlElement;
20 import javax.xml.bind.annotation.XmlType;
21
22 /**
23  * See {@link AVMFritzBaseModel}.
24  *
25  * @author Robert Bausdorf - Initial contribution
26  * @author Christoph Weitkamp - Added support for groups
27  * @author Ulrich Mertin - Added support for HAN-FUN blinds
28  */
29 @XmlAccessorType(XmlAccessType.FIELD)
30 @XmlType(name = "device")
31 public class DeviceModel extends AVMFritzBaseModel {
32
33     private TemperatureModel temperature;
34     private HumidityModel humidity;
35     private AlertModel alert;
36     private LevelcontrolModel levelcontrol;
37
38     @XmlElement(name = "button", type = ButtonModel.class)
39     private List<ButtonModel> buttons;
40
41     private ETSUnitInfoModel etsiunitinfo;
42
43     public TemperatureModel getTemperature() {
44         return temperature;
45     }
46
47     public void setTemperature(TemperatureModel temperatureModel) {
48         this.temperature = temperatureModel;
49     }
50
51     public HumidityModel getHumidity() {
52         return humidity;
53     }
54
55     public void setHumidity(HumidityModel humidityModel) {
56         this.humidity = humidityModel;
57     }
58
59     public AlertModel getAlert() {
60         return alert;
61     }
62
63     public void setAlert(AlertModel alertModel) {
64         this.alert = alertModel;
65     }
66
67     public LevelcontrolModel getLevelcontrol() {
68         return levelcontrol;
69     }
70
71     public void setLevelcontrol(LevelcontrolModel levelcontrol) {
72         this.levelcontrol = levelcontrol;
73     }
74
75     public List<ButtonModel> getButtons() {
76         return buttons == null ? List.of() : buttons;
77     }
78
79     public void setButtons(List<ButtonModel> buttons) {
80         this.buttons = buttons;
81     }
82
83     public ETSUnitInfoModel getEtsiunitinfo() {
84         return etsiunitinfo;
85     }
86
87     public void setEtsiunitinfo(ETSUnitInfoModel etsiunitinfo) {
88         this.etsiunitinfo = etsiunitinfo;
89     }
90
91     @Override
92     public String toString() {
93         return new StringBuilder().append(super.toString()).append(temperature).append(",").append(humidity).append(",")
94                 .append(alert).append(",").append(getButtons()).append(",").append(etsiunitinfo).append("]").toString();
95     }
96
97     @XmlAccessorType(XmlAccessType.FIELD)
98     @XmlType(propOrder = { "etsideviceid", "unittype", "interfaces" })
99     public static class ETSUnitInfoModel {
100         public static final String HAN_FUN_UNITTYPE_SIMPLE_BUTTON = "273";
101         public static final String HAN_FUN_UNITTYPE_SIMPLE_DETECTOR = "512";
102         public static final String HAN_FUN_UNITTYPE_MAGNETIC_CONTACT = "513";
103         public static final String HAN_FUN_UNITTYPE_OPTICAL_CONTACT = "514";
104         public static final String HAN_FUN_UNITTYPE_MOTION_DETECTOR = "515";
105         public static final String HAN_FUN_UNITTYPE_SMOKE_DETECTOR = "516";
106         public static final String HAN_FUN_UNITTYPE_FLOOD_DETECTOR = "518";
107         public static final String HAN_FUN_UNITTYPE_GLAS_BREAK_DETECTOR = "519";
108         public static final String HAN_FUN_UNITTYPE_VIBRATION_DETECTOR = "520";
109
110         public static final String HAN_FUN_INTERFACE_ALERT = "256";
111         public static final String HAN_FUN_INTERFACE_KEEP_ALIVE = "277";
112         public static final String HAN_FUN_INTERFACE_SIMPLE_BUTTON = "772";
113
114         private String etsideviceid;
115         private String unittype;
116         private String interfaces;
117
118         public String getEtsideviceid() {
119             return etsideviceid;
120         }
121
122         public void setEtsideviceid(String etsideviceid) {
123             this.etsideviceid = etsideviceid;
124         }
125
126         public String getUnittype() {
127             return unittype;
128         }
129
130         public void setUnittype(String unittype) {
131             this.unittype = unittype;
132         }
133
134         public String getInterfaces() {
135             return interfaces;
136         }
137
138         public void setInterfaces(String interfaces) {
139             this.interfaces = interfaces;
140         }
141
142         @Override
143         public String toString() {
144             return new StringBuilder().append("[etsideviceid=").append(etsideviceid).append(",unittype=")
145                     .append(unittype).append(",interfaces=").append(interfaces).append("]").toString();
146         }
147     }
148 }