2 * Copyright (c) 2010-2022 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.data.NetatmoConstants.AlimentationStatus;
20 import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.BatteryState;
21 import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FloodLightMode;
22 import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.SdCardStatus;
23 import org.openhab.core.library.types.OnOffType;
24 import org.openhab.core.library.types.OpenClosedType;
25 import org.openhab.core.types.State;
26 import org.openhab.core.types.UnDefType;
29 * The {@link HomeStatusModule} holds module informations returned by getHomeData endpoint
31 * @author Gaƫl L'hopital - Initial contribution
36 public class HomeStatusModule extends NAThing {
37 private @Nullable String firmwareName;
38 private @Nullable String wifiState;
39 private @Nullable String status;
40 private @Nullable OnOffType monitoring;
41 private FloodLightMode floodlight = FloodLightMode.UNKNOWN;
42 private SdCardStatus sdStatus = SdCardStatus.UNKNOWN;
43 private AlimentationStatus alimStatus = AlimentationStatus.UNKNOWN;
44 private @Nullable String sirenStatus;
45 private @Nullable String vpnUrl;
46 private boolean isLocal;
47 private BatteryState batteryState = BatteryState.UNKNOWN;
48 private int batteryLevel;
50 private @Nullable OpenClosedType boilerStatus;
51 private boolean boilerValveComfortBoost;
53 public State getBoilerStatus() {
54 OpenClosedType status = boilerStatus;
55 return status != null ? status : UnDefType.NULL;
58 public boolean getBoilerValveComfortBoost() {
59 return boilerValveComfortBoost;
62 public Optional<String> getFirmwareName() {
63 return Optional.ofNullable(firmwareName);
66 public Optional<String> getWifiState() {
67 return Optional.ofNullable(wifiState);
70 public Optional<String> getStatus() {
71 return Optional.ofNullable(status);
74 public State getMonitoring() {
75 OnOffType localStatus = monitoring;
76 return localStatus != null ? localStatus : UnDefType.NULL;
79 public FloodLightMode getFloodlight() {
83 public SdCardStatus getSdStatus() {
87 public AlimentationStatus getAlimStatus() {
91 public Optional<String> getSirenStatus() {
92 return Optional.ofNullable(sirenStatus);
95 public @Nullable String getVpnUrl() {
99 public boolean isLocal() {
103 public BatteryState getBatteryState() {
107 public int getBatteryLevel() {