]> git.basschouten.com Git - openhab-addons.git/blob
d4b9d8b29b0cf2286beb40df48e9dc87956f3298
[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.mybmw.internal.utils;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.mybmw.internal.MyBMWBridgeConfiguration;
17
18 /**
19  * 
20  * checks if the configuration is valid
21  * 
22  * @author Bernd Weymann - Initial contribution
23  * @author Martin Grassl - extracted to own class
24  */
25 @NonNullByDefault
26 public final class MyBMWConfigurationChecker {
27     public static boolean checkConfiguration(MyBMWBridgeConfiguration config) {
28         if (config.userName.isBlank() || config.password.isBlank()) {
29             return false;
30         } else {
31             return BimmerConstants.EADRAX_SERVER_MAP.containsKey(config.region);
32         }
33     }
34 }