]> git.basschouten.com Git - openhab-addons.git/blob
a2928a8b1af0ef0b3f4080b030cd8769bdb3e1bc
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.yamahamusiccast.internal.dto;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * This class represents the Status request requested from the Yamaha model/device via the API.
19  *
20  * @author Lennert Coopman - Initial contribution
21  */
22
23 public class Status {
24
25     @SerializedName("response_code")
26     private String responseCode;
27
28     @SerializedName("power")
29     private String power;
30
31     @SerializedName("mute")
32     private String mute;
33
34     @SerializedName("volume")
35     private int volume;
36
37     @SerializedName("max_volume")
38     private int maxVolume = 1;
39
40     @SerializedName("input")
41     private String input;
42
43     @SerializedName("sound_program")
44     private String soundProgram;
45
46     @SerializedName("sleep")
47     private int sleep = 0;
48
49     public String getResponseCode() {
50         if (responseCode == null) {
51             responseCode = "";
52         }
53         return responseCode;
54     }
55
56     public String getPower() {
57         if (power == null) {
58             power = "";
59         }
60         return power;
61     }
62
63     public String getMute() {
64         if (mute == null) {
65             mute = "";
66         }
67         return mute;
68     }
69
70     public int getVolume() {
71         return volume;
72     }
73
74     public int getMaxVolume() {
75         // if no value is returned, set to 1 to avoid division by zero
76         if (maxVolume == 0) {
77             maxVolume = 1;
78         }
79         return maxVolume;
80     }
81
82     public String getInput() {
83         if (input == null) {
84             input = "";
85         }
86         return input;
87     }
88
89     public String getSoundProgram() {
90         if (soundProgram == null) {
91             soundProgram = "";
92         }
93         return soundProgram;
94     }
95
96     public int getSleep() {
97         return sleep;
98     }
99 }