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;
36 public NAObjectMap<HomeStatusModule> getModules() {
37 NAObjectMap<HomeStatusModule> localModules = modules;
38 return localModules != null ? localModules : new NAObjectMap<>();
42 public class Energy extends HomeStatus {
43 private NAObjectMap<Room> rooms = new NAObjectMap<>();
45 public NAObjectMap<Room> getRooms() {
50 public class Security extends HomeStatus {
51 private NAObjectMap<HomeStatusPerson> persons = new NAObjectMap<>();
53 public NAObjectMap<HomeStatusPerson> getPersons() {
58 private @Nullable HomeStatus home;
60 public Optional<HomeStatus> getHomeStatus() {
61 return Optional.ofNullable(home);