]> git.basschouten.com Git - openhab-addons.git/blob
393e6f947b60f80511cf4b313e75e2ccdf6d4bfe
[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 org.eclipse.jdt.annotation.Nullable;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * This class represents the UDP event received from the Yamaha model/device.
21  *
22  * @author Lennert Coopman - Initial contribution
23  * @author Florian Hotze - Add volume in decibel
24  */
25
26 public class UdpMessage {
27
28     @SerializedName("device_id")
29     private String deviceId;
30
31     public String getDeviceId() {
32         if (deviceId == null) {
33             deviceId = "";
34         }
35         return deviceId;
36     }
37
38     @SerializedName("main")
39     private Zone main;
40     @SerializedName("zone2")
41     private Zone zone2;
42     @SerializedName("zone3")
43     private Zone zone3;
44     @SerializedName("zone4")
45     private Zone zone4;
46     @SerializedName("netusb")
47     private NetUSB netusb;
48     @SerializedName("dist")
49     private Dist dist;
50
51     public Zone getMain() {
52         return main;
53     }
54
55     public Zone getZone2() {
56         return zone2;
57     }
58
59     public Zone getZone3() {
60         return zone3;
61     }
62
63     public Zone getZone4() {
64         return zone4;
65     }
66
67     public NetUSB getNetUSB() {
68         return netusb;
69     }
70
71     public Dist getDist() {
72         return dist;
73     }
74
75     public class Zone {
76         @SerializedName("power")
77         private String power;
78         @SerializedName("volume")
79         private int volume = 0;
80         @SerializedName("actual_volume")
81         private ActualVolume actualVolume;
82         @SerializedName("mute")
83         private String mute;
84         @SerializedName("input")
85         private String input;
86         @SerializedName("status_updated")
87         private String statusUpdated;
88
89         public String getPower() {
90             if (power == null) {
91                 power = "";
92             }
93             return power;
94         }
95
96         public String getMute() {
97             if (mute == null) {
98                 mute = "";
99             }
100             return mute;
101         }
102
103         public String getInput() {
104             if (input == null) {
105                 input = "";
106             }
107             return input;
108         }
109
110         public int getVolume() {
111             return volume;
112         }
113
114         public @Nullable ActualVolume getActualVolume() {
115             return actualVolume;
116         }
117
118         public String getstatusUpdated() {
119             if (statusUpdated == null) {
120                 statusUpdated = "";
121             }
122             return statusUpdated;
123         }
124     }
125
126     public class NetUSB {
127         @SerializedName("preset_control")
128         private PresetControl presetControl;
129         @SerializedName("play_info_updated")
130         private String playInfoUpdated;
131         @SerializedName("play_time")
132         private int playTime;
133
134         public PresetControl getPresetControl() {
135             return presetControl;
136         }
137
138         public String getPlayInfoUpdated() {
139             if (playInfoUpdated == null) {
140                 playInfoUpdated = "";
141             }
142             return playInfoUpdated;
143         }
144
145         public int getPlayTime() {
146             return playTime;
147         }
148     }
149
150     public class PresetControl {
151         @SerializedName("type")
152         private String type;
153         @SerializedName("num")
154         private int num = 1;
155         @SerializedName("result")
156         private String result;
157
158         public String getType() {
159             if (type == null) {
160                 type = "";
161             }
162             return type;
163         }
164
165         public String getResult() {
166             if (result == null) {
167                 result = "";
168             }
169             return result;
170         }
171
172         public int getNum() {
173             return num;
174         }
175     }
176
177     public class Dist {
178         @SerializedName("dist_info_updated")
179         private String distInfoUpdated;
180
181         public String getDistInfoUpdated() {
182             if (distInfoUpdated == null) {
183                 distInfoUpdated = "";
184             }
185             return distInfoUpdated;
186         }
187     }
188 }