]> git.basschouten.com Git - openhab-addons.git/blob
26174e868ca5dfc16ac299a85ec3b1926a346d32
[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.sleepiq.internal.api.dto;
14
15 import org.openhab.binding.sleepiq.internal.api.enums.FoundationPreset;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * The {@link FoundationStatusResponse} holds the status of the foundation
21  * returned from the sleepiq API.
22  *
23  * @author Mark Hilbush - Initial contribution
24  */
25 public class FoundationStatusResponse {
26     @SerializedName("fsType")
27     private String type;
28
29     @SerializedName("fsRightHeadPosition")
30     private FoundationPosition rightHeadPosition;
31
32     @SerializedName("fsRightFootPosition")
33     private FoundationPosition rightFootPosition;
34
35     @SerializedName("fsLeftHeadPosition")
36     private FoundationPosition leftHeadPosition;
37
38     @SerializedName("fsLeftFootPosition")
39     private FoundationPosition leftFootPosition;
40
41     @SerializedName("fsCurrentPositionPresetRight")
42     private FoundationPreset currentPositionPresetRight;
43
44     @SerializedName("fsCurrentPositionPresetLeft")
45     private FoundationPreset currentPositionPresetLeft;
46
47     @SerializedName("fsOutletsOn")
48     private boolean outletsOn;
49
50     public String getType() {
51         return type;
52     }
53
54     public int getRightHeadPosition() {
55         return rightHeadPosition.getFoundationPosition().intValue();
56     }
57
58     public int getLeftHeadPosition() {
59         return leftHeadPosition.getFoundationPosition().intValue();
60     }
61
62     public int getRightFootPosition() {
63         return rightFootPosition.getFoundationPosition().intValue();
64     }
65
66     public int getLeftFootPosition() {
67         return leftFootPosition.getFoundationPosition().intValue();
68     }
69
70     public FoundationPreset getCurrentPositionPresetRight() {
71         return currentPositionPresetRight;
72     }
73
74     public FoundationPreset getCurrentPositionPresetLeft() {
75         return currentPositionPresetLeft;
76     }
77
78     public boolean getOutletsOn() {
79         return outletsOn;
80     }
81
82     @Override
83     public String toString() {
84         StringBuilder builder = new StringBuilder();
85         builder.append("FoundationStatusResponse [");
86         builder.append("type=");
87         builder.append(type);
88         builder.append("rightHeadPosition=");
89         builder.append(rightHeadPosition);
90         builder.append(", leftHeadPosition=");
91         builder.append(leftHeadPosition);
92         builder.append(", rightFootPosition=");
93         builder.append(rightFootPosition);
94         builder.append(", leftFootPosition=");
95         builder.append(leftFootPosition);
96         builder.append(", currentPositionPresetRight=");
97         builder.append(currentPositionPresetRight);
98         builder.append(", currentPositionPresetLeft=");
99         builder.append(currentPositionPresetLeft);
100         builder.append(", outletsOn=");
101         builder.append(outletsOn);
102         builder.append("]");
103         return builder.toString();
104     }
105 }