]> git.basschouten.com Git - openhab-addons.git/blob
90ea1bc9e425c2607e6c18d1069e44b17022111a
[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.denonmarantz.internal.xml.entities.commands;
14
15 import javax.xml.bind.annotation.XmlAccessType;
16 import javax.xml.bind.annotation.XmlAccessorType;
17 import javax.xml.bind.annotation.XmlAttribute;
18 import javax.xml.bind.annotation.XmlRootElement;
19 import javax.xml.bind.annotation.XmlValue;
20
21 /**
22  * Individual commands that can be sent to a Denon/Marantz receiver to request specific information.
23  *
24  * @author Jeroen Idserda - Initial contribution
25  */
26 @XmlRootElement(name = "cmd")
27 @XmlAccessorType(XmlAccessType.FIELD)
28 public class CommandTx {
29
30     private static final String DEFAULT_ID = "1";
31
32     public static final CommandTx CMD_ALL_POWER = of("GetAllZonePowerStatus");
33
34     public static final CommandTx CMD_VOLUME_LEVEL = of("GetVolumeLevel");
35
36     public static final CommandTx CMD_MUTE_STATUS = of("GetMuteStatus");
37
38     public static final CommandTx CMD_SOURCE_STATUS = of("GetSourceStatus");
39
40     public static final CommandTx CMD_SURROUND_STATUS = of("GetSurroundModeStatus");
41
42     public static final CommandTx CMD_ZONE_NAME = of("GetZoneName");
43
44     public static final CommandTx CMD_NET_STATUS = of("GetNetAudioStatus");
45
46     public static final CommandTx CMD_RENAME_SOURCE = of("GetRenameSource");
47
48     public static final CommandTx CMD_DELETED_SOURCE = of("GetDeletedSource");
49
50     @XmlAttribute(name = "id")
51     private String id;
52
53     @XmlValue
54     private String value;
55
56     public CommandTx() {
57     }
58
59     public CommandTx(String value) {
60         this.value = value;
61     }
62
63     public String getId() {
64         return id;
65     }
66
67     public void setId(String id) {
68         this.id = id;
69     }
70
71     public static CommandTx of(String command) {
72         CommandTx cmdTx = new CommandTx(command);
73         cmdTx.setId(DEFAULT_ID);
74         return cmdTx;
75     }
76 }