]> git.basschouten.com Git - openhab-addons.git/blob
baad63a36ed47914c1f0460fae63e36ece531688
[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.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 int nextSenderId = 0;
50
51     public EnOceanBridgeConfig() {
52         espVersion = "ESP3";
53     }
54
55     public ESPVersion getESPVersion() {
56         return ESPVersion.getESPVersion(espVersion);
57     }
58 }