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.bticinosmarther.internal.api.dto;
15 import java.util.List;
17 import org.eclipse.jdt.annotation.Nullable;
20 * The {@code ModuleStatus} class defines the dto for Smarther API module status object.
22 * @author Fabio Possieri - Initial contribution
24 public class ModuleStatus {
26 private List<Chronothermostat> chronothermostats;
29 * Returns the chronothermostat details of this module status.
31 * @return the chronothermostat details
33 public List<Chronothermostat> getChronothermostats() {
34 return chronothermostats;
38 * Returns the first chronothermostat item contained in this module status.
40 * @return the first chronothermostat item, or {@code null} in case of no item found
42 public @Nullable Chronothermostat toChronothermostat() {
43 return (!chronothermostats.isEmpty() && chronothermostats.get(0) != null) ? chronothermostats.get(0) : null;
47 public String toString() {
48 return String.format("chronothermostats=[%s]", chronothermostats);