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 com.google.gson.annotations.SerializedName;
18 * This class represents the Status request requested from the Yamaha model/device via the API.
20 * @author Lennert Coopman - Initial contribution
21 * @author Florian Hotze - Add volume in decibel
26 @SerializedName("response_code")
27 private String responseCode;
29 @SerializedName("power")
32 @SerializedName("mute")
35 @SerializedName("volume")
38 @SerializedName("actual_volume")
39 private ActualVolume actualVolume;
41 @SerializedName("max_volume")
42 private int maxVolume = 1;
44 @SerializedName("input")
47 @SerializedName("sound_program")
48 private String soundProgram;
50 @SerializedName("sleep")
51 private int sleep = 0;
53 public String getResponseCode() {
54 if (responseCode == null) {
60 public String getPower() {
67 public String getMute() {
74 public int getVolume() {
79 * Get the volume in decibel (dB).
81 * @return volume in dB or -90 dB if not available
83 public float getVolumeDb() {
84 if (actualVolume == null)
86 return actualVolume.getValue();
89 public int getMaxVolume() {
90 // if no value is returned, set to 1 to avoid division by zero
97 public String getInput() {
104 public String getSoundProgram() {
105 if (soundProgram == null) {
111 public int getSleep() {