]> git.basschouten.com Git - openhab-addons.git/blob
9534cbbc51a3c6e7d4177e888397772805c68511
[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.solaredge.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Bean holding configuration data according to bridge.xml
20  *
21  * @author Alexander Friese - initial contribution
22  */
23 @NonNullByDefault
24 public class SolarEdgeConfiguration {
25
26     private @Nullable String tokenOrApiKey;
27     private @Nullable String solarId;
28
29     private boolean meterInstalled = false;
30     private boolean usePrivateApi = false;
31
32     private Integer asyncTimeout = 120;
33     private Integer syncTimeout = 120;
34     private Integer liveDataPollingInterval = 10;
35     private Integer aggregateDataPollingInterval = 60;
36
37     public @Nullable String getTokenOrApiKey() {
38         return tokenOrApiKey;
39     }
40
41     public void setTokenOrApiKey(String tokenOrApiKey) {
42         this.tokenOrApiKey = tokenOrApiKey;
43     }
44
45     public @Nullable String getSolarId() {
46         return solarId;
47     }
48
49     public void setSolarId(String solarId) {
50         this.solarId = solarId;
51     }
52
53     public Integer getAsyncTimeout() {
54         return asyncTimeout;
55     }
56
57     public void setAsyncTimeout(Integer asyncTimeout) {
58         this.asyncTimeout = asyncTimeout;
59     }
60
61     public Integer getSyncTimeout() {
62         return syncTimeout;
63     }
64
65     public void setSyncTimeout(Integer syncTimeout) {
66         this.syncTimeout = syncTimeout;
67     }
68
69     public Integer getLiveDataPollingInterval() {
70         return liveDataPollingInterval;
71     }
72
73     public void setLiveDataPollingInterval(Integer liveDataPollingInterval) {
74         this.liveDataPollingInterval = liveDataPollingInterval;
75     }
76
77     public Integer getAggregateDataPollingInterval() {
78         return aggregateDataPollingInterval;
79     }
80
81     public void setAggregateDataPollingInterval(Integer aggregateDataPollingInterval) {
82         this.aggregateDataPollingInterval = aggregateDataPollingInterval;
83     }
84
85     public boolean isMeterInstalled() {
86         return meterInstalled;
87     }
88
89     public void setMeterInstalled(boolean meterInstalled) {
90         this.meterInstalled = meterInstalled;
91     }
92
93     public boolean isUsePrivateApi() {
94         return usePrivateApi;
95     }
96
97     public void setUsePrivateApi(boolean usePrivateApi) {
98         this.usePrivateApi = usePrivateApi;
99     }
100
101     @Override
102     public String toString() {
103         return getClass().getSimpleName() + "{ tokenOrApiKey=" + getTokenOrApiKey() + ", solarId=" + getSolarId()
104                 + ", meterInstalled=" + isMeterInstalled() + ", usePrivateApi=" + isUsePrivateApi()
105                 + ", live data pollingInterval=" + getLiveDataPollingInterval() + ", aggregate data pollingInterval="
106                 + getAggregateDataPollingInterval() + ", asyncTimeout=" + getAsyncTimeout() + ", syncTimeout="
107                 + getSyncTimeout() + "}";
108     }
109 }