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.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;
36 private @Nullable NAObjectMap<Room> rooms;
37 private @Nullable NAObjectMap<HomeStatusPerson> persons;
39 public NAObjectMap<HomeStatusModule> getModules() {
40 NAObjectMap<HomeStatusModule> local = modules;
41 return local != null ? local : new NAObjectMap<>();
44 public NAObjectMap<Room> getRooms() {
45 NAObjectMap<Room> local = rooms;
46 return local != null ? local : new NAObjectMap<>();
49 public NAObjectMap<HomeStatusPerson> getPersons() {
50 NAObjectMap<HomeStatusPerson> local = persons;
51 return local != null ? local : new NAObjectMap<>();
55 private @Nullable HomeStatus home;
56 private List<NAError> errors = List.of();
58 public Optional<HomeStatus> getHomeStatus() {
59 return Optional.ofNullable(home);
62 public List<NAError> getErrors() {