]> git.basschouten.com Git - openhab-addons.git/blob
37054508bff47233c1cc9991121f9a8fe2658ce2
[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.mecmeter;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The {@link MecMeterDeviceConfiguration} is the class used to match the
20  * thing configuration.
21  *
22  * @author Florian Pazour - Initial contribution
23  * @author Klaus Berger - Initial contribution
24  */
25 @NonNullByDefault
26 public class MecMeterDeviceConfiguration {
27     public String ip = "";
28     public String password = "12345";
29     public int refreshInterval = 5;
30
31     public String getIp() {
32         return ip;
33     }
34
35     public void setIp(String inetaddress) {
36         ip = inetaddress;
37     }
38
39     public String getPassword() {
40         return password;
41     }
42
43     public void setPassword(String pw) {
44         password = pw;
45     }
46
47     public int getRefreshInterval() {
48         return refreshInterval;
49     }
50
51     public void setRefreshInterval(int ri) {
52         refreshInterval = ri;
53     }
54
55     public @Nullable String isValid() {
56         if (ip.isBlank()) {
57             return "Missing IP";
58         }
59         if (password.isBlank()) {
60             return "Password is missing";
61         }
62         return null;
63     }
64 }