2 * Copyright (c) 2010-2021 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.avmfritz.internal.dto;
15 import java.util.List;
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;
23 * See {@link AVMFritzBaseModel}.
25 * @author Robert Bausdorf - Initial contribution
26 * @author Christoph Weitkamp - Added support for groups
27 * @author Ulrich Mertin - Added support for HAN-FUN blinds
29 @XmlAccessorType(XmlAccessType.FIELD)
30 @XmlType(name = "device")
31 public class DeviceModel extends AVMFritzBaseModel {
33 private TemperatureModel temperature;
34 private HumidityModel humidity;
35 private AlertModel alert;
36 private LevelcontrolModel levelcontrol;
38 @XmlElement(name = "button", type = ButtonModel.class)
39 private List<ButtonModel> buttons;
41 private ETSUnitInfoModel etsiunitinfo;
43 public TemperatureModel getTemperature() {
47 public void setTemperature(TemperatureModel temperatureModel) {
48 this.temperature = temperatureModel;
51 public HumidityModel getHumidity() {
55 public void setHumidity(HumidityModel humidityModel) {
56 this.humidity = humidityModel;
59 public AlertModel getAlert() {
63 public void setAlert(AlertModel alertModel) {
64 this.alert = alertModel;
67 public LevelcontrolModel getLevelcontrol() {
71 public void setLevelcontrol(LevelcontrolModel levelcontrol) {
72 this.levelcontrol = levelcontrol;
75 public List<ButtonModel> getButtons() {
76 return buttons == null ? List.of() : buttons;
79 public void setButtons(List<ButtonModel> buttons) {
80 this.buttons = buttons;
83 public ETSUnitInfoModel getEtsiunitinfo() {
87 public void setEtsiunitinfo(ETSUnitInfoModel etsiunitinfo) {
88 this.etsiunitinfo = etsiunitinfo;
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();
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";
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";
114 private String etsideviceid;
115 private String unittype;
116 private String interfaces;
118 public String getEtsideviceid() {
122 public void setEtsideviceid(String etsideviceid) {
123 this.etsideviceid = etsideviceid;
126 public String getUnittype() {
130 public void setUnittype(String unittype) {
131 this.unittype = unittype;
134 public String getInterfaces() {
138 public void setInterfaces(String interfaces) {
139 this.interfaces = interfaces;
143 public String toString() {
144 return new StringBuilder().append("[etsideviceid=").append(etsideviceid).append(",unittype=")
145 .append(unittype).append(",interfaces=").append(interfaces).append("]").toString();