]> git.basschouten.com Git - openhab-addons.git/blob
2b619af26f14c54ec41c6951004d9737173fbb78
[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.tr064.internal.config;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.OpenHAB;
20
21 /**
22  * The {@link Tr064RootConfiguration} class contains fields mapping thing configuration parameters.
23  *
24  * @author Jan N. Klug - Initial contribution
25  */
26 @NonNullByDefault
27 public class Tr064RootConfiguration extends Tr064BaseThingConfiguration {
28     public static final int DEFAULT_HTTP_TIMEOUT = 5; // in s
29
30     public String host = "";
31     public String user = "dslf-config";
32     public String password = "";
33     public int timeout = DEFAULT_HTTP_TIMEOUT;
34
35     /* following parameters only available in fritzbox thing */
36     public List<String> tamIndices = List.of();
37     public List<String> callDeflectionIndices = List.of();
38     public List<String> missedCallDays = List.of();
39     public List<String> rejectedCallDays = List.of();
40     public List<String> inboundCallDays = List.of();
41     public List<String> outboundCallDays = List.of();
42     public List<String> callListDays = List.of();
43     public List<String> wanBlockIPs = List.of();
44     public int phonebookInterval = 600;
45
46     // Backup data
47     public String backupDirectory = OpenHAB.getUserDataFolder();
48     public @Nullable String backupPassword;
49
50     public boolean isValid() {
51         return !host.isEmpty() && !user.isEmpty() && !password.isEmpty();
52     }
53 }