2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.netatmo.internal.config;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FeatureArea;
19 * The {@link HomeConfiguration} is responsible for holding configuration information for any
20 * Netatmo Home - security or energy, or both
22 * @author Gaƫl L'hopital - Initial contribution
25 public class HomeConfiguration extends NAThingConfiguration {
26 public String securityId = "";
27 public String energyId = "";
30 public String getId() {
31 return getIdForArea(energyId.isBlank() ? FeatureArea.SECURITY : FeatureArea.ENERGY);
34 public String getIdForArea(FeatureArea feature) {
35 return FeatureArea.ENERGY.equals(feature) ? energyId.isBlank() ? id : energyId
36 : FeatureArea.SECURITY.equals(feature) ? securityId.isBlank() ? id : securityId : id;