2 * Copyright (c) 2010-2023 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.api.dto;
15 import java.util.Optional;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.netatmo.internal.api.ApiResponse;
20 import org.openhab.binding.netatmo.internal.deserialization.NAObjectMap;
23 * The {@link NAHomeStatus} holds data for a given home.
25 * @author Gaƫl L'hopital - Initial contribution
29 public class NAHomeStatus {
30 public class NAHomeStatusResponse extends ApiResponse<NAHomeStatus> {
33 public class HomeStatus extends NAThing {
34 private @Nullable NAObjectMap<HomeStatusModule> modules;
35 private @Nullable NAObjectMap<HomeStatusPerson> persons;
36 private @Nullable NAObjectMap<Room> rooms;
38 public NAObjectMap<HomeStatusModule> getModules() {
39 NAObjectMap<HomeStatusModule> localModules = modules;
40 return localModules != null ? localModules : new NAObjectMap<>();
43 public NAObjectMap<HomeStatusPerson> getPersons() {
44 NAObjectMap<HomeStatusPerson> localPersons = persons;
45 return localPersons != null ? localPersons : new NAObjectMap<>();
48 public NAObjectMap<Room> getRooms() {
49 NAObjectMap<Room> localRooms = rooms;
50 return localRooms != null ? localRooms : new NAObjectMap<>();
54 private @Nullable HomeStatus home;
56 public Optional<HomeStatus> getHomeStatus() {
57 return Optional.ofNullable(home);