]> git.basschouten.com Git - openhab-addons.git/blob
f80e07c67abd8abb29bffa8bb87554219f1c4539
[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.amplipi.internal.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 import io.swagger.v3.oas.annotations.media.Schema;
18
19 /**
20  * Audio output to a stereo pair of speakers, typically belonging to a room
21  **/
22 @Schema(description = "Audio output to a stereo pair of speakers, typically belonging to a room ")
23 public class Zone {
24
25     @Schema
26     /**
27      * Unique identifier
28      **/
29     private Integer id;
30
31     @Schema(required = true)
32     /**
33      * Friendly name
34      **/
35     private String name;
36
37     @Schema
38     @SerializedName("source_id")
39     /**
40      * id of the connected source
41      **/
42     private Integer sourceId = 0;
43
44     @Schema
45     /**
46      * Set to true if output is muted
47      **/
48     private Boolean mute = true;
49
50     @Schema
51     /**
52      * Output volume in dB
53      **/
54     private Integer vol = -79;
55
56     @Schema
57     /**
58      * Set to true if not connected to a speaker
59      **/
60     private Boolean disabled = false;
61
62     /**
63      * Unique identifier
64      *
65      * @return id
66      **/
67     public Integer getId() {
68         return id;
69     }
70
71     public void setId(Integer id) {
72         this.id = id;
73     }
74
75     public Zone id(Integer id) {
76         this.id = id;
77         return this;
78     }
79
80     /**
81      * Friendly name
82      *
83      * @return name
84      **/
85     public String getName() {
86         return name;
87     }
88
89     public void setName(String name) {
90         this.name = name;
91     }
92
93     public Zone name(String name) {
94         this.name = name;
95         return this;
96     }
97
98     /**
99      * id of the connected source
100      * minimum: 0
101      * maximum: 3
102      *
103      * @return sourceId
104      **/
105     public Integer getSourceId() {
106         return sourceId;
107     }
108
109     public void setSourceId(Integer sourceId) {
110         this.sourceId = sourceId;
111     }
112
113     public Zone sourceId(Integer sourceId) {
114         this.sourceId = sourceId;
115         return this;
116     }
117
118     /**
119      * Set to true if output is muted
120      *
121      * @return mute
122      **/
123     public Boolean getMute() {
124         return mute;
125     }
126
127     public void setMute(Boolean mute) {
128         this.mute = mute;
129     }
130
131     public Zone mute(Boolean mute) {
132         this.mute = mute;
133         return this;
134     }
135
136     /**
137      * Output volume in dB
138      * minimum: -79
139      * maximum: 0
140      *
141      * @return vol
142      **/
143     public Integer getVol() {
144         return vol;
145     }
146
147     public void setVol(Integer vol) {
148         this.vol = vol;
149     }
150
151     public Zone vol(Integer vol) {
152         this.vol = vol;
153         return this;
154     }
155
156     /**
157      * Set to true if not connected to a speaker
158      *
159      * @return disabled
160      **/
161     public Boolean getDisabled() {
162         return disabled;
163     }
164
165     public void setDisabled(Boolean disabled) {
166         this.disabled = disabled;
167     }
168
169     public Zone disabled(Boolean disabled) {
170         this.disabled = disabled;
171         return this;
172     }
173
174     @Override
175     public String toString() {
176         StringBuilder sb = new StringBuilder();
177         sb.append("class Zone {\n");
178
179         sb.append("    id: ").append(toIndentedString(id)).append("\n");
180         sb.append("    name: ").append(toIndentedString(name)).append("\n");
181         sb.append("    sourceId: ").append(toIndentedString(sourceId)).append("\n");
182         sb.append("    mute: ").append(toIndentedString(mute)).append("\n");
183         sb.append("    vol: ").append(toIndentedString(vol)).append("\n");
184         sb.append("    disabled: ").append(toIndentedString(disabled)).append("\n");
185         sb.append("}");
186         return sb.toString();
187     }
188
189     /**
190      * Convert the given object to string with each line indented by 4 spaces
191      * (except the first line).
192      */
193     private static String toIndentedString(Object o) {
194         if (o == null) {
195             return "null";
196         }
197         return o.toString().replace("\n", "\n    ");
198     }
199 }