]> git.basschouten.com Git - openhab-addons.git/blob
4ecc1930d900c4c67c72e44b5b0e007ec18a872a
[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.homematic.internal.model;
14
15 /**
16  * Info object which holds gateway specific informations.
17  *
18  * @author Gerhard Riegler - Initial contribution
19  */
20 public class HmGatewayInfo {
21     public static final String ID_HOMEGEAR = "HOMEGEAR";
22     public static final String ID_CCU = "CCU";
23     public static final String ID_DEFAULT = "DEFAULT";
24
25     private String id;
26     private String type;
27     private String firmware;
28     private String address;
29     private boolean rfInterface;
30     private boolean wiredInterface;
31     private boolean cuxdInterface;
32     private boolean hmipInterface;
33     private boolean groupInterface;
34
35     /**
36      * Returns the id of the gateway type.
37      */
38     public String getId() {
39         return id;
40     }
41
42     /**
43      * Sets the id of the gateway type.
44      */
45     public void setId(String id) {
46         this.id = id;
47     }
48
49     /**
50      * Returns the type of the gateway.
51      */
52     public String getType() {
53         return type;
54     }
55
56     /**
57      * Sets the type of the server.
58      */
59     public void setType(String type) {
60         this.type = type;
61     }
62
63     /**
64      * Returns the firmware version of the gateway.
65      */
66     public String getFirmware() {
67         return firmware;
68     }
69
70     /**
71      * Sets the firmware version of the gateway.
72      */
73     public void setFirmware(String firmware) {
74         this.firmware = firmware;
75     }
76
77     /**
78      * Returns the address of the Homematic gateway.
79      */
80     public String getAddress() {
81         return address;
82     }
83
84     /**
85      * Sets the address of the Homematic gateway.
86      */
87     public void setAddress(String address) {
88         this.address = address;
89     }
90
91     /**
92      * Returns true, if the gateway is a Homegear gateway.
93      */
94     public boolean isHomegear() {
95         return ID_HOMEGEAR.equals(id);
96     }
97
98     /**
99      * Returns true, if the gateway is a CCU.
100      */
101     public boolean isCCU() {
102         return ID_CCU.equals(id);
103     }
104
105     /**
106      * Return true, if the gateway is a CCU1.
107      */
108     public boolean isCCU1() {
109         return "CCU".equals(type);
110     }
111
112     /**
113      * Returns true, if the gateway supports the CUxD interface.
114      */
115     public boolean isCuxdInterface() {
116         return cuxdInterface;
117     }
118
119     /**
120      * Sets the CUxD support of the gateway.
121      */
122     public void setCuxdInterface(boolean cuxdInterface) {
123         this.cuxdInterface = cuxdInterface;
124     }
125
126     /**
127      * Returns true, if the gateway supports the wired interface.
128      */
129     public boolean isWiredInterface() {
130         return wiredInterface;
131     }
132
133     /**
134      * Sets the wired support of the gateway.
135      */
136     public void setWiredInterface(boolean wiredInterface) {
137         this.wiredInterface = wiredInterface;
138     }
139
140     /**
141      * Returns true, if the gateway supports the HMIP interface.
142      */
143     public boolean isHmipInterface() {
144         return hmipInterface;
145     }
146
147     /**
148      * Sets the HMIP support of the gateway.
149      */
150     public void setHmipInterface(boolean hmipInterface) {
151         this.hmipInterface = hmipInterface;
152     }
153
154     /**
155      * Returns true, if the gateway supports the Group interface.
156      */
157     public boolean isGroupInterface() {
158         return groupInterface;
159     }
160
161     /**
162      * Sets the Group support of the gateway.
163      */
164     public void setGroupInterface(boolean groupInterface) {
165         this.groupInterface = groupInterface;
166     }
167
168     /**
169      * Returns true, if the gateway supports the RF interface.
170      */
171     public boolean isRfInterface() {
172         return rfInterface;
173     }
174
175     /**
176      * Sets the RF support of the gateway.
177      */
178     public void setRfInterface(boolean rfInterface) {
179         this.rfInterface = rfInterface;
180     }
181
182     @Override
183     public String toString() {
184         return String.format("%s[id=%s,type=%s,firmware=%s,address=%s,rf=%b,wired=%b,hmip=%b,cuxd=%b,group=%b]",
185                 getClass().getSimpleName(), id, type, firmware, address, rfInterface, wiredInterface, hmipInterface,
186                 cuxdInterface, groupInterface);
187     }
188 }