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