]> git.basschouten.com Git - openhab-addons.git/blob
4d5eaa52f204b9e4a47f7a31b70a2ab9fcc67dfa
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.nikohomecontrol.internal.protocol.nhc2;
14
15 import java.util.ArrayList;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 import com.google.gson.annotations.SerializedName;
20
21 /**
22  * {@link NhcSystemInfo2} represents Niko Home Control II system info. It is used when parsing the systeminfo response
23  * json.
24  *
25  * @author Mark Herwege - Initial Contribution
26  */
27 @NonNullByDefault
28 public class NhcSystemInfo2 {
29     static class NhcSwVersion {
30         String nhcVersion = "";
31         String cocoImage = "";
32     }
33
34     String lastConfig = "";
35     String waterTariff = "";
36     String electricityTariff = "";
37     String gasTariff = "";
38     String currency = "";
39     String units = "";
40     String language = "";
41     @SerializedName(value = "SWversions")
42     ArrayList<NhcSwVersion> swVersions = new ArrayList<>();
43
44     /**
45      * @return the NhcVersion
46      */
47     public String getNhcVersion() {
48         return swVersions.stream().map(p -> p.nhcVersion).filter(v -> !v.isEmpty()).findFirst().orElse("");
49     }
50
51     /**
52      * @return the CocoImage version
53      */
54     public String getCocoImage() {
55         return swVersions.stream().map(p -> p.cocoImage).filter(v -> !v.isEmpty()).findFirst().orElse("");
56     }
57
58     /**
59      * @return the lastConfig
60      */
61     public String getLastConfig() {
62         return lastConfig;
63     }
64
65     /**
66      * @return the waterTariff
67      */
68     public String getWaterTariff() {
69         return waterTariff;
70     }
71
72     /**
73      * @return the electricityTariff
74      */
75     public String getElectricityTariff() {
76         return electricityTariff;
77     }
78
79     /**
80      * @return the gasTariff
81      */
82     public String getGasTariff() {
83         return gasTariff;
84     }
85
86     /**
87      * @return the currency
88      */
89     public String getCurrency() {
90         return currency;
91     }
92
93     /**
94      * @return the units
95      */
96     public String getUnits() {
97         return units;
98     }
99
100     /**
101      * @return the language
102      */
103     public String getLanguage() {
104         return language;
105     }
106 }