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.List;
16 import java.util.Optional;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.netatmo.internal.api.ApiResponse;
21 import org.openhab.binding.netatmo.internal.deserialization.NAObjectMap;
24 * The {@link NAHomeStatus} holds data for a given home.
26 * @author Gaƫl L'hopital - Initial contribution
30 public class NAHomeStatus {
31 public class NAHomeStatusResponse extends ApiResponse<NAHomeStatus> {
34 public class HomeStatus extends NAThing {
35 private @Nullable NAObjectMap<HomeStatusModule> modules;
37 public NAObjectMap<HomeStatusModule> getModules() {
38 NAObjectMap<HomeStatusModule> localModules = modules;
39 return localModules != null ? localModules : new NAObjectMap<>();
43 public class Energy extends HomeStatus {
44 private NAObjectMap<Room> rooms = new NAObjectMap<>();
46 public NAObjectMap<Room> getRooms() {
51 public class Security extends HomeStatus {
52 private NAObjectMap<HomeStatusPerson> persons = new NAObjectMap<>();
54 public NAObjectMap<HomeStatusPerson> getPersons() {
59 private @Nullable HomeStatus home;
60 private List<NAError> errors = List.of();
62 public Optional<HomeStatus> getHomeStatus() {
63 return Optional.ofNullable(home);
66 public List<NAError> getErrors() {