]> git.basschouten.com Git - openhab-addons.git/blob
d100e188d186b7690a7492bc3af2cb5b783ca67e
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.enocean.internal.config;
14
15 /**
16  *
17  * @author Daniel Weber - Initial contribution
18  */
19 public class EnOceanBridgeConfig {
20
21     public enum ESPVersion {
22         UNKNOWN("unknown"),
23         ESP3("ESP3"),
24         ESP2("ESP2");
25
26         private String version;
27
28         ESPVersion(String version) {
29             this.version = version;
30         }
31
32         public static ESPVersion getESPVersion(String espVersion) {
33             for (ESPVersion version : values()) {
34                 if (version.version.equalsIgnoreCase(espVersion)) {
35                     return version;
36                 }
37             }
38
39             return ESPVersion.UNKNOWN;
40         }
41     }
42
43     public String path;
44
45     public String espVersion;
46     public boolean rs485;
47     public String rs485BaseId;
48
49     public Integer nextSenderId;
50
51     public boolean enableSmack;
52     public boolean sendTeachOuts;
53
54     public EnOceanBridgeConfig() {
55         espVersion = "ESP3";
56         sendTeachOuts = false;
57         enableSmack = true;
58         nextSenderId = null;
59     }
60
61     public ESPVersion getESPVersion() {
62         return ESPVersion.getESPVersion(espVersion);
63     }
64 }