2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.yamahamusiccast.internal.dto;
15 import org.eclipse.jdt.annotation.Nullable;
17 import com.google.gson.annotations.SerializedName;
20 * This class represents the UDP event received from the Yamaha model/device.
22 * @author Lennert Coopman - Initial contribution
23 * @author Florian Hotze - Add volume in decibel
26 public class UdpMessage {
28 @SerializedName("device_id")
29 private String deviceId;
31 public String getDeviceId() {
32 if (deviceId == null) {
38 @SerializedName("main")
40 @SerializedName("zone2")
42 @SerializedName("zone3")
44 @SerializedName("zone4")
46 @SerializedName("netusb")
47 private NetUSB netusb;
48 @SerializedName("dist")
51 public Zone getMain() {
55 public Zone getZone2() {
59 public Zone getZone3() {
63 public Zone getZone4() {
67 public NetUSB getNetUSB() {
71 public Dist getDist() {
76 @SerializedName("power")
78 @SerializedName("volume")
79 private int volume = 0;
80 @SerializedName("actual_volume")
81 private ActualVolume actualVolume;
82 @SerializedName("mute")
84 @SerializedName("input")
86 @SerializedName("status_updated")
87 private String statusUpdated;
89 public String getPower() {
96 public String getMute() {
103 public String getInput() {
110 public int getVolume() {
114 public @Nullable ActualVolume getActualVolume() {
118 public String getstatusUpdated() {
119 if (statusUpdated == null) {
122 return statusUpdated;
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;
134 public PresetControl getPresetControl() {
135 return presetControl;
138 public String getPlayInfoUpdated() {
139 if (playInfoUpdated == null) {
140 playInfoUpdated = "";
142 return playInfoUpdated;
145 public int getPlayTime() {
150 public class PresetControl {
151 @SerializedName("type")
153 @SerializedName("num")
155 @SerializedName("result")
156 private String result;
158 public String getType() {
165 public String getResult() {
166 if (result == null) {
172 public int getNum() {
178 @SerializedName("dist_info_updated")
179 private String distInfoUpdated;
181 public String getDistInfoUpdated() {
182 if (distInfoUpdated == null) {
183 distInfoUpdated = "";
185 return distInfoUpdated;