import java.util.LinkedHashMap;
import java.util.Map;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.type.ChannelTypeUID;
*
* @author Jan-Willem Veldhuis - Initial contribution
*/
+@NonNullByDefault
public class DenonMarantzBindingConstants {
public static final String BINDING_ID = "denonmarantz";
import java.math.BigDecimal;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.PercentType;
* @author Jan-Willem Veldhuis - Initial contribution
*
*/
+@NonNullByDefault
public class DenonMarantzState {
- private State power;
- private State mainZonePower;
- private State mute;
- private State mainVolume;
- private State mainVolumeDB;
- private State input;
- private State surroundProgram;
+ private @Nullable State power;
+ private @Nullable State mainZonePower;
+ private @Nullable State mute;
+ private @Nullable State mainVolume;
+ private @Nullable State mainVolumeDB;
+ private @Nullable State input;
+ private @Nullable State surroundProgram;
- private State artist;
- private State album;
- private State track;
+ private @Nullable State artist;
+ private @Nullable State album;
+ private @Nullable State track;
// ------ Zones ------
- private State zone2Power;
- private State zone2Volume;
- private State zone2VolumeDB;
- private State zone2Mute;
- private State zone2Input;
-
- private State zone3Power;
- private State zone3Volume;
- private State zone3VolumeDB;
- private State zone3Mute;
- private State zone3Input;
-
- private State zone4Power;
- private State zone4Volume;
- private State zone4VolumeDB;
- private State zone4Mute;
- private State zone4Input;
+ private @Nullable State zone2Power;
+ private @Nullable State zone2Volume;
+ private @Nullable State zone2VolumeDB;
+ private @Nullable State zone2Mute;
+ private @Nullable State zone2Input;
+
+ private @Nullable State zone3Power;
+ private @Nullable State zone3Volume;
+ private @Nullable State zone3VolumeDB;
+ private @Nullable State zone3Mute;
+ private @Nullable State zone3Input;
+
+ private @Nullable State zone4Power;
+ private @Nullable State zone4Volume;
+ private @Nullable State zone4VolumeDB;
+ private @Nullable State zone4Mute;
+ private @Nullable State zone4Input;
private DenonMarantzStateChangedListener handler;
handler.connectionError(errorMessage);
}
- public State getStateForChannelID(String channelID) {
+ public @Nullable State getStateForChannelID(String channelID) {
switch (channelID) {
case DenonMarantzBindingConstants.CHANNEL_POWER:
return power;
OnOffType newVal = OnOffType.from(power);
if (newVal != this.power) {
this.power = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_POWER, this.power);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_POWER, newVal);
}
}
OnOffType newVal = OnOffType.from(mainPower);
if (newVal != this.mainZonePower) {
this.mainZonePower = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_ZONE_POWER, this.mainZonePower);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_ZONE_POWER, newVal);
}
}
OnOffType newVal = OnOffType.from(mute);
if (newVal != this.mute) {
this.mute = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MUTE, this.mute);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MUTE, newVal);
}
}
PercentType newVal = new PercentType(volume);
if (!newVal.equals(this.mainVolume)) {
this.mainVolume = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_VOLUME, this.mainVolume);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_VOLUME, newVal);
// update the main volume in dB too
- this.mainVolumeDB = DecimalType.valueOf(volume.subtract(DenonMarantzBindingConstants.DB_OFFSET).toString());
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_VOLUME_DB, this.mainVolumeDB);
+ State mainVolumeDB = this.mainVolumeDB = DecimalType
+ .valueOf(volume.subtract(DenonMarantzBindingConstants.DB_OFFSET).toString());
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_MAIN_VOLUME_DB, mainVolumeDB);
}
}
StringType newVal = StringType.valueOf(input);
if (!newVal.equals(this.input)) {
this.input = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_INPUT, this.input);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_INPUT, newVal);
}
}
StringType newVal = StringType.valueOf(surroundProgram);
if (!newVal.equals(this.surroundProgram)) {
this.surroundProgram = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_SURROUND_PROGRAM, this.surroundProgram);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_SURROUND_PROGRAM, newVal);
}
}
public void setNowPlayingArtist(String artist) {
- StringType newVal = artist == null || artist.isBlank() ? StringType.EMPTY : StringType.valueOf(artist);
+ StringType newVal = artist.isBlank() ? StringType.EMPTY : StringType.valueOf(artist);
if (!newVal.equals(this.artist)) {
this.artist = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_ARTIST, this.artist);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_ARTIST, newVal);
}
}
public void setNowPlayingAlbum(String album) {
- StringType newVal = album == null || album.isBlank() ? StringType.EMPTY : StringType.valueOf(album);
+ StringType newVal = album.isBlank() ? StringType.EMPTY : StringType.valueOf(album);
if (!newVal.equals(this.album)) {
this.album = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_ALBUM, this.album);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_ALBUM, newVal);
}
}
public void setNowPlayingTrack(String track) {
- StringType newVal = track == null || track.isBlank() ? StringType.EMPTY : StringType.valueOf(track);
+ StringType newVal = track.isBlank() ? StringType.EMPTY : StringType.valueOf(track);
if (!newVal.equals(this.track)) {
this.track = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_TRACK, this.track);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_NOW_PLAYING_TRACK, newVal);
}
}
OnOffType newVal = OnOffType.from(power);
if (newVal != this.zone2Power) {
this.zone2Power = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_POWER, this.zone2Power);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_POWER, newVal);
}
}
PercentType newVal = new PercentType(volume);
if (!newVal.equals(this.zone2Volume)) {
this.zone2Volume = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_VOLUME, this.zone2Volume);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_VOLUME, newVal);
// update the volume in dB too
- this.zone2VolumeDB = DecimalType
+ State zone2VolumeDB = this.zone2VolumeDB = DecimalType
.valueOf(volume.subtract(DenonMarantzBindingConstants.DB_OFFSET).toString());
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_VOLUME_DB, this.zone2VolumeDB);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_VOLUME_DB, zone2VolumeDB);
}
}
OnOffType newVal = OnOffType.from(mute);
if (newVal != this.zone2Mute) {
this.zone2Mute = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_MUTE, this.zone2Mute);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_MUTE, newVal);
}
}
StringType newVal = StringType.valueOf(zone2Input);
if (!newVal.equals(this.zone2Input)) {
this.zone2Input = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_INPUT, this.zone2Input);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_INPUT, newVal);
}
}
OnOffType newVal = OnOffType.from(power);
if (newVal != this.zone3Power) {
this.zone3Power = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_POWER, this.zone3Power);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_POWER, newVal);
}
}
PercentType newVal = new PercentType(volume);
if (!newVal.equals(this.zone3Volume)) {
this.zone3Volume = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_VOLUME, this.zone3Volume);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_VOLUME, newVal);
// update the volume in dB too
- this.zone3VolumeDB = DecimalType
+ State zone3VolumeDB = this.zone3VolumeDB = DecimalType
.valueOf(volume.subtract(DenonMarantzBindingConstants.DB_OFFSET).toString());
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_VOLUME_DB, this.zone3VolumeDB);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_VOLUME_DB, zone3VolumeDB);
}
}
OnOffType newVal = OnOffType.from(mute);
if (newVal != this.zone3Mute) {
this.zone3Mute = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_MUTE, this.zone3Mute);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE3_MUTE, newVal);
}
}
StringType newVal = StringType.valueOf(zone3Input);
if (!newVal.equals(this.zone3Input)) {
this.zone3Input = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_INPUT, this.zone3Input);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE2_INPUT, newVal);
}
}
OnOffType newVal = OnOffType.from(power);
if (newVal != this.zone4Power) {
this.zone4Power = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_POWER, this.zone4Power);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_POWER, newVal);
}
}
PercentType newVal = new PercentType(volume);
if (!newVal.equals(this.zone4Volume)) {
this.zone4Volume = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_VOLUME, this.zone4Volume);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_VOLUME, newVal);
// update the volume in dB too
- this.zone4VolumeDB = DecimalType
+ State zone4VolumeDB = this.zone4VolumeDB = DecimalType
.valueOf(volume.subtract(DenonMarantzBindingConstants.DB_OFFSET).toString());
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_VOLUME_DB, this.zone4VolumeDB);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_VOLUME_DB, zone4VolumeDB);
}
}
OnOffType newVal = OnOffType.from(mute);
if (newVal != this.zone4Mute) {
this.zone4Mute = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_MUTE, this.zone4Mute);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_MUTE, newVal);
}
}
StringType newVal = StringType.valueOf(zone4Input);
if (!newVal.equals(this.zone4Input)) {
this.zone4Input = newVal;
- handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_INPUT, this.zone4Input);
+ handler.stateChanged(DenonMarantzBindingConstants.CHANNEL_ZONE4_INPUT, newVal);
}
}
}
*/
package org.openhab.binding.denonmarantz.internal;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
/**
* Exception thrown when an unsupported command type is sent to a channel.
*
* @author Jan-Willem Veldhuis - Initial contribution
*
*/
+@NonNullByDefault
public class UnsupportedCommandTypeException extends Exception {
private static final long serialVersionUID = 42L;
import java.math.BigDecimal;
import java.util.List;
-import org.openhab.binding.denonmarantz.internal.connector.DenonMarantzConnector;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
/**
* Configuration class for the Denon Marantz binding.
* @author Jan-Willem Veldhuis - Initial contribution
*
*/
+@NonNullByDefault
public class DenonMarantzConfiguration {
/**
* The hostname (or IP Address) of the Denon Marantz AVR
*/
- public String host;
+ public String host = "";
/**
* Whether Telnet communication is enabled
*/
- public Boolean telnetEnabled;
+ public @Nullable Boolean telnetEnabled;
/**
* The telnet port
*/
- public Integer telnetPort;
+ public Integer telnetPort = 23;
/**
* The HTTP port
*/
- public Integer httpPort;
+ public Integer httpPort = 80;
/**
* The interval to poll the AVR over HTTP for changes
*/
- public Integer httpPollingInterval;
+ public Integer httpPollingInterval = 5;
// Default maximum volume
public static final BigDecimal MAX_VOLUME = new BigDecimal("98");
- private DenonMarantzConnector connector;
-
- private Integer zoneCount;
+ private Integer zoneCount = 2;
private BigDecimal mainVolumeMax = MAX_VOLUME;
- public List<String> inputOptions;
+ public @Nullable List<String> inputOptions;
public String getHost() {
return host;
this.host = host;
}
- public Boolean isTelnet() {
+ public @Nullable Boolean isTelnet() {
return telnetEnabled;
}
this.httpPort = httpPort;
}
- public DenonMarantzConnector getConnector() {
- return connector;
- }
-
- public void setConnector(DenonMarantzConnector connector) {
- this.connector = connector;
- }
-
public BigDecimal getMainVolumeMax() {
return mainVolumeMax;
}
import java.math.RoundingMode;
import java.util.concurrent.ScheduledExecutorService;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.denonmarantz.internal.DenonMarantzState;
import org.openhab.binding.denonmarantz.internal.UnsupportedCommandTypeException;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
*
* @author Jan-Willem Veldhuis - Initial contribution
*/
+@NonNullByDefault
public abstract class DenonMarantzConnector {
private static final BigDecimal POINTFIVE = new BigDecimal("0.5");
protected abstract void internalSendCommand(String command);
+ public DenonMarantzConnector(DenonMarantzConfiguration config, ScheduledExecutorService scheduler,
+ DenonMarantzState state) {
+ this.config = config;
+ this.scheduler = scheduler;
+ this.state = state;
+ }
+
public void sendCustomCommand(Command command) throws UnsupportedCommandTypeException {
String cmd;
if (command instanceof StringType) {
import java.util.concurrent.ScheduledExecutorService;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jetty.client.HttpClient;
import org.openhab.binding.denonmarantz.internal.DenonMarantzState;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
*
* @author Jan-Willem Veldhuis - Initial contribution
*/
+@NonNullByDefault
public class DenonMarantzConnectorFactory {
public DenonMarantzConnector getConnector(DenonMarantzConfiguration config, DenonMarantzState state,
ScheduledExecutorService scheduler, HttpClient httpClient, String thingUID) {
- if (config.isTelnet()) {
+ Boolean isTelnet = config.isTelnet();
+ if (isTelnet != null && isTelnet) {
return new DenonMarantzTelnetConnector(config, state, scheduler, thingUID);
} else {
return new DenonMarantzHttpConnector(config, state, scheduler, httpClient);
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.util.StreamReaderDelegate;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.Response;
import org.openhab.binding.denonmarantz.internal.DenonMarantzState;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
import org.openhab.binding.denonmarantz.internal.connector.DenonMarantzConnector;
-import org.openhab.binding.denonmarantz.internal.xml.entities.Deviceinfo;
-import org.openhab.binding.denonmarantz.internal.xml.entities.Main;
-import org.openhab.binding.denonmarantz.internal.xml.entities.ZoneStatus;
-import org.openhab.binding.denonmarantz.internal.xml.entities.ZoneStatusLite;
-import org.openhab.binding.denonmarantz.internal.xml.entities.commands.AppCommandRequest;
-import org.openhab.binding.denonmarantz.internal.xml.entities.commands.AppCommandResponse;
-import org.openhab.binding.denonmarantz.internal.xml.entities.commands.CommandRx;
-import org.openhab.binding.denonmarantz.internal.xml.entities.commands.CommandTx;
+import org.openhab.binding.denonmarantz.internal.xml.dto.Deviceinfo;
+import org.openhab.binding.denonmarantz.internal.xml.dto.Main;
+import org.openhab.binding.denonmarantz.internal.xml.dto.ZoneStatus;
+import org.openhab.binding.denonmarantz.internal.xml.dto.ZoneStatusLite;
+import org.openhab.binding.denonmarantz.internal.xml.dto.commands.AppCommandRequest;
+import org.openhab.binding.denonmarantz.internal.xml.dto.commands.AppCommandResponse;
+import org.openhab.binding.denonmarantz.internal.xml.dto.commands.CommandRx;
+import org.openhab.binding.denonmarantz.internal.xml.dto.commands.CommandTx;
import org.openhab.core.io.net.http.HttpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* @author Jeroen Idserda - Initial Contribution (1.x Binding)
* @author Jan-Willem Veldhuis - Refactored for 2.x
*/
+@NonNullByDefault
public class DenonMarantzHttpConnector extends DenonMarantzConnector {
private Logger logger = LoggerFactory.getLogger(DenonMarantzHttpConnector.class);
private final HttpClient httpClient;
- private ScheduledFuture<?> pollingJob;
+ private @Nullable ScheduledFuture<?> pollingJob;
public DenonMarantzHttpConnector(DenonMarantzConfiguration config, DenonMarantzState state,
ScheduledExecutorService scheduler, HttpClient httpClient) {
- this.config = config;
- this.scheduler = scheduler;
- this.state = state;
+ super(config, scheduler, state);
this.cmdUrl = String.format("http://%s:%d/goform/formiPhoneAppDirect.xml?", config.getHost(),
config.getHttpPort());
this.statusUrl = String.format("http://%s:%d/goform/", config.getHost(), config.getHttpPort());
}
private boolean isPolling() {
+ ScheduledFuture<?> pollingJob = this.pollingJob;
return pollingJob != null && !pollingJob.isCancelled();
}
private void stopPolling() {
- if (isPolling()) {
+ ScheduledFuture<?> pollingJob = this.pollingJob;
+ if (pollingJob != null) {
pollingJob.cancel(true);
logger.debug("HTTP polling stopped.");
}
@Override
protected void internalSendCommand(String command) {
logger.debug("Sending command '{}'", command);
- if (command == null || command.isBlank()) {
+ if (command.isBlank()) {
logger.warn("Trying to send empty command");
return;
}
httpClient.newRequest(url).timeout(5, TimeUnit.SECONDS).send(new Response.CompleteListener() {
@Override
- public void onComplete(Result result) {
- if (result.getResponse().getStatus() != 200) {
+ public void onComplete(@Nullable Result result) {
+ if (result != null && result.getResponse().getStatus() != 200) {
logger.warn("Error {} while sending command", result.getResponse().getReason());
}
}
AppCommandRequest request = AppCommandRequest.of(CommandTx.CMD_NET_STATUS);
AppCommandResponse response = postDocument(url, AppCommandResponse.class, request);
- if (response != null) {
- CommandRx titleInfo = response.getCommands().get(0);
- state.setNowPlayingArtist(titleInfo.getText("artist"));
- state.setNowPlayingAlbum(titleInfo.getText("album"));
- state.setNowPlayingTrack(titleInfo.getText("track"));
+ if (response == null) {
+ return;
+ }
+ CommandRx titleInfo = response.getCommands().get(0);
+ String artist = titleInfo.getText("artist");
+ if (artist != null) {
+ state.setNowPlayingArtist(artist);
+ }
+ String album = titleInfo.getText("album");
+ if (album != null) {
+ state.setNowPlayingAlbum(album);
+ }
+ String track = titleInfo.getText("track");
+ if (track != null) {
+ state.setNowPlayingTrack(track);
}
}
import java.net.Socket;
import java.net.SocketTimeoutException;
+import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
import org.slf4j.Logger;
* @author Jeroen Idserda - Initial contribution (1.x Binding)
* @author Jan-Willem Veldhuis - Refactored for 2.x
*/
+@NonNullByDefault
public class DenonMarantzTelnetClientThread extends Thread {
private Logger logger = LoggerFactory.getLogger(DenonMarantzTelnetClientThread.class);
private boolean connected = false;
- private Socket socket;
+ private @Nullable Socket socket;
- private OutputStreamWriter out;
+ private @Nullable OutputStreamWriter out;
private @Nullable BufferedReader in;
} catch (SocketTimeoutException e) {
logger.trace("Socket timeout");
// Disconnects are not always detected unless you write to the socket.
- try {
- out.write('\r');
- out.flush();
- } catch (IOException e2) {
- logger.debug("Error writing to socket");
- connected = false;
+ OutputStreamWriter out = this.out;
+ if (out != null) {
+ try {
+ out.write('\r');
+ out.flush();
+ } catch (IOException e2) {
+ logger.debug("Error writing to socket");
+ connected = false;
+ }
}
} catch (IOException e) {
if (!isInterrupted()) {
}
public void sendCommand(String command) {
+ OutputStreamWriter out = this.out;
if (out != null) {
try {
out.write(command + '\r');
disconnect();
int delay = 0;
+ Socket socket = this.socket;
while (!isInterrupted() && (socket == null || !socket.isConnected())) {
try {
Thread.sleep(delay);
// Use raw socket instead of TelnetClient here because TelnetClient sends an
// extra newline char after each write which causes the connection to become
// unresponsive.
- socket = new Socket();
+ socket = this.socket = new Socket();
socket.connect(new InetSocketAddress(config.getHost(), config.getTelnetPort()), TIMEOUT);
socket.setKeepAlive(true);
socket.setSoTimeout(TIMEOUT);
}
private void disconnect() {
+ Socket socket = this.socket;
if (socket != null) {
logger.debug("Disconnecting socket");
try {
} catch (IOException e) {
logger.debug("Error while disconnecting telnet client", e);
} finally {
- socket = null;
+ this.socket = null;
out = null;
in = null;
listener.telnetClientConnected(false);
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Pattern;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.denonmarantz.internal.DenonMarantzState;
import org.openhab.binding.denonmarantz.internal.config.DenonMarantzConfiguration;
import org.openhab.binding.denonmarantz.internal.connector.DenonMarantzConnector;
* @author Jeroen Idserda - Initial Contribution (1.x Binding)
* @author Jan-Willem Veldhuis - Refactored for 2.x
*/
+@NonNullByDefault
public class DenonMarantzTelnetConnector extends DenonMarantzConnector implements DenonMarantzTelnetListener {
private final Logger logger = LoggerFactory.getLogger(DenonMarantzTelnetConnector.class);
private static final BigDecimal NINETYNINE = new BigDecimal("99");
- private DenonMarantzTelnetClientThread telnetClientThread;
+ private @Nullable DenonMarantzTelnetClientThread telnetClientThread;
private boolean displayNowplaying = false;
protected boolean disposing = false;
- private Future<?> telnetStateRequest;
+ private @Nullable Future<?> telnetStateRequest;
private String thingUID;
public DenonMarantzTelnetConnector(DenonMarantzConfiguration config, DenonMarantzState state,
ScheduledExecutorService scheduler, String thingUID) {
- this.config = config;
- this.scheduler = scheduler;
- this.state = state;
+ super(config, scheduler, state);
this.thingUID = thingUID;
}
*/
@Override
public void connect() {
- telnetClientThread = new DenonMarantzTelnetClientThread(config, this);
+ DenonMarantzTelnetClientThread telnetClientThread = this.telnetClientThread = new DenonMarantzTelnetClientThread(
+ config, this);
telnetClientThread.setName("OH-binding-" + thingUID);
telnetClientThread.start();
}
@Override
public void telnetClientConnected(boolean connected) {
if (!connected) {
- if (config.isTelnet() && !disposing) {
+ Boolean isTelnet = config.isTelnet();
+ if (isTelnet != null && isTelnet && !disposing) {
logger.debug("Telnet client disconnected.");
state.connectionError(
"Error connecting to the telnet port. Consider disabling telnet in this Thing's configuration to use HTTP polling instead.");
logger.debug("disposing connector");
disposing = true;
+ Future<?> telnetStateRequest = this.telnetStateRequest;
if (telnetStateRequest != null) {
telnetStateRequest.cancel(true);
- telnetStateRequest = null;
+ this.telnetStateRequest = null;
}
+ DenonMarantzTelnetClientThread telnetClientThread = this.telnetClientThread;
if (telnetClientThread != null) {
telnetClientThread.interrupt();
// Invoke a shutdown after interrupting the thread to close the socket immediately,
// otherwise the client keeps running until a line was received from the telnet connection
telnetClientThread.shutdown();
- telnetClientThread = null;
+ this.telnetClientThread = null;
}
}
@Override
protected void internalSendCommand(String command) {
logger.debug("Sending command '{}'", command);
- if (command == null || command.isBlank()) {
+ if (command.isBlank()) {
logger.warn("Trying to send empty command");
return;
}
- telnetClientThread.sendCommand(command);
+ DenonMarantzTelnetClientThread telnetClientThread = this.telnetClientThread;
+ if (telnetClientThread != null) {
+ telnetClientThread.sendCommand(command);
+ }
}
/**
*/
package org.openhab.binding.denonmarantz.internal.connector.telnet;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
/**
* Listener interface used to notify the
* {@link org.openhab.binding.denonmarantz.internal.connector.DenonMarantzConnector} about received messages over Telnet
* @author Jan-Willem Veldhuis - Initial contribution
*
*/
+@NonNullByDefault
public interface DenonMarantzTelnetListener {
/**
* The telnet client has received a line.
import javax.xml.bind.annotation.adapters.XmlAdapter;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
/**
* Maps 'On' and 'Off' string values to a boolean
*
* @author Jeroen Idserda - Initial contribution
*/
-public class OnOffAdapter extends XmlAdapter<String, Boolean> {
+@NonNullByDefault
+public class OnOffAdapter extends XmlAdapter<@Nullable String, @Nullable Boolean> {
@Override
- public Boolean unmarshal(String v) throws Exception {
+ public @Nullable Boolean unmarshal(@Nullable String v) throws Exception {
if (v != null) {
return Boolean.valueOf("on".equals(v.toLowerCase()));
}
}
@Override
- public String marshal(Boolean v) throws Exception {
+ public @Nullable String marshal(@Nullable Boolean v) throws Exception {
return v ? "On" : "Off";
}
}
import javax.xml.bind.annotation.adapters.XmlAdapter;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
/**
* Adapter to clean up string values
*
* @author Jeroen Idserda - Initial contribution
*/
-public class StringAdapter extends XmlAdapter<String, String> {
+@NonNullByDefault
+public class StringAdapter extends XmlAdapter<@Nullable String, @Nullable String> {
@Override
- public String unmarshal(String v) throws Exception {
+ public @Nullable String unmarshal(@Nullable String v) throws Exception {
String val = v;
if (val != null) {
return val.trim();
}
@Override
- public String marshal(String v) throws Exception {
+ public @Nullable String marshal(@Nullable String v) throws Exception {
return v;
}
}
import javax.xml.bind.annotation.adapters.XmlAdapter;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
/**
* Maps Denon volume values in db to percentage
*
* @author Jeroen Idserda - Initial contribution
*/
-public class VolumeAdapter extends XmlAdapter<String, BigDecimal> {
+@NonNullByDefault
+public class VolumeAdapter extends XmlAdapter<@Nullable String, BigDecimal> {
@Override
- public BigDecimal unmarshal(String v) throws Exception {
+ public BigDecimal unmarshal(@Nullable String v) throws Exception {
if (v != null && !"--".equals(v.trim())) {
return new BigDecimal(v.trim()).add(DB_OFFSET);
}
}
@Override
- public String marshal(BigDecimal v) throws Exception {
+ public @Nullable String marshal(BigDecimal v) throws Exception {
if (v.equals(BigDecimal.ZERO)) {
return "--";
}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Contains information about a Denon/Marantz receiver.
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "device_Info")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Deviceinfo {
+
+ private Integer deviceZones;
+
+ private String modelName;
+
+ public Integer getDeviceZones() {
+ return deviceZones;
+ }
+
+ public void setDeviceZones(Integer deviceZones) {
+ this.deviceZones = deviceZones;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.OnOffType;
+
+/**
+ * Holds information about the Main zone of the receiver
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "item")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Main {
+
+ private OnOffType power;
+
+ public OnOffType getPower() {
+ return power;
+ }
+
+ public void setPower(OnOffType power) {
+ this.power = power;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.OnOffType;
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.StringType;
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.VolumeType;
+
+/**
+ * Holds information about the secondary zones of the receiver
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "item")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ZoneStatus {
+
+ private OnOffType power;
+
+ @XmlElementWrapper(name = "inputFuncList")
+ @XmlElement(name = "value")
+ private List<String> inputFunctions;
+
+ private StringType inputFuncSelect;
+
+ private StringType volumeDisplay;
+
+ private StringType surrMode;
+
+ private VolumeType masterVolume;
+
+ private OnOffType mute;
+
+ public OnOffType getPower() {
+ return power;
+ }
+
+ public void setPower(OnOffType power) {
+ this.power = power;
+ }
+
+ public StringType getInputFuncSelect() {
+ return inputFuncSelect;
+ }
+
+ public void setInputFuncSelect(StringType inputFuncSelect) {
+ this.inputFuncSelect = inputFuncSelect;
+ }
+
+ public StringType getVolumeDisplay() {
+ return volumeDisplay;
+ }
+
+ public void setVolumeDisplay(StringType volumeDisplay) {
+ this.volumeDisplay = volumeDisplay;
+ }
+
+ public StringType getSurrMode() {
+ return surrMode;
+ }
+
+ public void setSurrMode(StringType surrMode) {
+ this.surrMode = surrMode;
+ }
+
+ public VolumeType getMasterVolume() {
+ return masterVolume;
+ }
+
+ public void setMasterVolume(VolumeType masterVolume) {
+ this.masterVolume = masterVolume;
+ }
+
+ public OnOffType getMute() {
+ return mute;
+ }
+
+ public void setMute(OnOffType mute) {
+ this.mute = mute;
+ }
+
+ public List<String> getInputFuncList() {
+ return this.inputFunctions;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.OnOffType;
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.StringType;
+import org.openhab.binding.denonmarantz.internal.xml.dto.types.VolumeType;
+
+/**
+ * Holds limited information about the secondary zones of the receiver
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "item")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ZoneStatusLite {
+
+ private OnOffType power;
+
+ private StringType inputFuncSelect;
+
+ private StringType volumeDisplay;
+
+ private VolumeType masterVolume;
+
+ private OnOffType mute;
+
+ public OnOffType getPower() {
+ return power;
+ }
+
+ public void setPower(OnOffType power) {
+ this.power = power;
+ }
+
+ public StringType getInputFuncSelect() {
+ return inputFuncSelect;
+ }
+
+ public void setInputFuncSelect(StringType inputFuncSelect) {
+ this.inputFuncSelect = inputFuncSelect;
+ }
+
+ public StringType getVolumeDisplay() {
+ return volumeDisplay;
+ }
+
+ public void setVolumeDisplay(StringType volumeDisplay) {
+ this.volumeDisplay = volumeDisplay;
+ }
+
+ public VolumeType getMasterVolume() {
+ return masterVolume;
+ }
+
+ public void setMasterVolume(VolumeType masterVolume) {
+ this.masterVolume = masterVolume;
+ }
+
+ public OnOffType getMute() {
+ return mute;
+ }
+
+ public void setMute(OnOffType mute) {
+ this.mute = mute;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * Wrapper for a list of {@link CommandTx}
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "tx")
+@XmlAccessorType(XmlAccessType.FIELD)
+@NonNullByDefault
+public class AppCommandRequest {
+
+ @XmlElement(name = "cmd")
+ private List<CommandTx> commands = new ArrayList<>();
+
+ public AppCommandRequest() {
+ }
+
+ public List<CommandTx> getCommands() {
+ return commands;
+ }
+
+ public void setCommands(List<CommandTx> commands) {
+ this.commands = commands;
+ }
+
+ public AppCommandRequest add(CommandTx command) {
+ commands.add(command);
+ return this;
+ }
+
+ public static AppCommandRequest of(CommandTx command) {
+ AppCommandRequest tx = new AppCommandRequest();
+ return tx.add(command);
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * Response to an {@link AppCommandRequest}, wraps a list of {@link CommandRx}
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "rx")
+@XmlAccessorType(XmlAccessType.FIELD)
+@NonNullByDefault
+public class AppCommandResponse {
+
+ @XmlElement(name = "cmd")
+ private List<CommandRx> commands = new ArrayList<>();
+
+ public AppCommandResponse() {
+ }
+
+ public List<CommandRx> getCommands() {
+ return commands;
+ }
+
+ public void setCommands(List<CommandRx> commands) {
+ this.commands = commands;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * Response to a {@link CommandTx}
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "cmd")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class CommandRx {
+
+ private String zone1;
+
+ private String zone2;
+
+ private String zone3;
+
+ private String zone4;
+
+ private String volume;
+
+ private String disptype;
+
+ private String dispvalue;
+
+ private String mute;
+
+ private String type;
+
+ @XmlElement(name = "text")
+ private List<Text> texts = new ArrayList<>();
+
+ @XmlElementWrapper(name = "functionrename")
+ @XmlElement(name = "list")
+ private List<RenameSourceList> renameSourceLists;
+
+ @XmlElementWrapper(name = "functiondelete")
+ @XmlElement(name = "list")
+ private List<DeletedSourceList> deletedSourceLists;
+
+ private String playstatus;
+
+ private String playcontents;
+
+ private String repeat;
+
+ private String shuffle;
+
+ private String source;
+
+ public CommandRx() {
+ }
+
+ public String getZone1() {
+ return zone1;
+ }
+
+ public void setZone1(String zone1) {
+ this.zone1 = zone1;
+ }
+
+ public String getZone2() {
+ return zone2;
+ }
+
+ public void setZone2(String zone2) {
+ this.zone2 = zone2;
+ }
+
+ public String getZone3() {
+ return zone3;
+ }
+
+ public void setZone3(String zone3) {
+ this.zone3 = zone3;
+ }
+
+ public String getZone4() {
+ return zone4;
+ }
+
+ public void setZone4(String zone4) {
+ this.zone4 = zone4;
+ }
+
+ public String getVolume() {
+ return volume;
+ }
+
+ public void setVolume(String volume) {
+ this.volume = volume;
+ }
+
+ public String getDisptype() {
+ return disptype;
+ }
+
+ public void setDisptype(String disptype) {
+ this.disptype = disptype;
+ }
+
+ public String getDispvalue() {
+ return dispvalue;
+ }
+
+ public void setDispvalue(String dispvalue) {
+ this.dispvalue = dispvalue;
+ }
+
+ public String getMute() {
+ return mute;
+ }
+
+ public void setMute(String mute) {
+ this.mute = mute;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getPlaystatus() {
+ return playstatus;
+ }
+
+ public void setPlaystatus(String playstatus) {
+ this.playstatus = playstatus;
+ }
+
+ public String getPlaycontents() {
+ return playcontents;
+ }
+
+ public void setPlaycontents(String playcontents) {
+ this.playcontents = playcontents;
+ }
+
+ public String getRepeat() {
+ return repeat;
+ }
+
+ public void setRepeat(String repeat) {
+ this.repeat = repeat;
+ }
+
+ public String getShuffle() {
+ return shuffle;
+ }
+
+ public void setShuffle(String shuffle) {
+ this.shuffle = shuffle;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public @Nullable String getText(@NonNull String key) {
+ for (Text text : texts) {
+ if (key.equals(text.getId())) {
+ return text.getValue();
+ }
+ }
+ return null;
+ }
+
+ public List<RenameSourceList> getRenameSourceLists() {
+ return renameSourceLists;
+ }
+
+ public List<DeletedSourceList> getDeletedSourceLists() {
+ return deletedSourceLists;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * Individual commands that can be sent to a Denon/Marantz receiver to request specific information.
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "cmd")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class CommandTx {
+
+ private static final String DEFAULT_ID = "1";
+
+ public static final CommandTx CMD_ALL_POWER = of("GetAllZonePowerStatus");
+
+ public static final CommandTx CMD_VOLUME_LEVEL = of("GetVolumeLevel");
+
+ public static final CommandTx CMD_MUTE_STATUS = of("GetMuteStatus");
+
+ public static final CommandTx CMD_SOURCE_STATUS = of("GetSourceStatus");
+
+ public static final CommandTx CMD_SURROUND_STATUS = of("GetSurroundModeStatus");
+
+ public static final CommandTx CMD_ZONE_NAME = of("GetZoneName");
+
+ public static final CommandTx CMD_NET_STATUS = of("GetNetAudioStatus");
+
+ public static final CommandTx CMD_RENAME_SOURCE = of("GetRenameSource");
+
+ public static final CommandTx CMD_DELETED_SOURCE = of("GetDeletedSource");
+
+ @XmlAttribute(name = "id")
+ private String id;
+
+ @XmlValue
+ private String value;
+
+ public CommandTx() {
+ }
+
+ public CommandTx(String value) {
+ this.value = value;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public static CommandTx of(String command) {
+ CommandTx cmdTx = new CommandTx(command);
+ cmdTx.setId(DEFAULT_ID);
+ return cmdTx;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Used to unmarshall {@code <list>} items of the {@code <functiondelete>} CommandRX.
+ *
+ * @author Jan-Willem Veldhuis - Initial contribution
+ */
+@XmlRootElement(name = "list")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class DeletedSourceList {
+
+ private String name;
+
+ private String funcName;
+
+ private Integer use;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getFuncName() {
+ return funcName;
+ }
+
+ public Integer getUse() {
+ return use;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Used to unmarshall {@code <list>} items of the {@code <functionrename>} CommandRX.
+ *
+ * @author Jan-Willem Veldhuis - Initial contribution
+ */
+@XmlRootElement(name = "list")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class RenameSourceList {
+
+ private String name;
+
+ private String rename;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getRename() {
+ return rename;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.commands;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * Holds text values with a certain id
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlRootElement(name = "text")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Text {
+
+ @XmlAttribute(name = "id")
+ private String id;
+
+ @XmlValue
+ private String value;
+
+ public Text() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.types;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.openhab.binding.denonmarantz.internal.xml.adapters.OnOffAdapter;
+
+/**
+ * Contains an On/Off value in the form of a boolean
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+public class OnOffType {
+
+ @XmlJavaTypeAdapter(OnOffAdapter.class)
+ private Boolean value;
+
+ public Boolean getValue() {
+ return value;
+ }
+
+ public void setValue(Boolean value) {
+ this.value = value;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.types;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.openhab.binding.denonmarantz.internal.xml.adapters.StringAdapter;
+
+/**
+ * Contains a string value
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+public class StringType {
+
+ @XmlJavaTypeAdapter(value = StringAdapter.class)
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.denonmarantz.internal.xml.dto.types;
+
+import java.math.BigDecimal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.openhab.binding.denonmarantz.internal.xml.adapters.VolumeAdapter;
+
+/**
+ * Contains a volume value (percentage)
+ *
+ * @author Jeroen Idserda - Initial contribution
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VolumeType {
+
+ @XmlJavaTypeAdapter(value = VolumeAdapter.class)
+ private BigDecimal value;
+
+ public BigDecimal getValue() {
+ return value;
+ }
+
+ public void setValue(BigDecimal value) {
+ this.value = value;
+ }
+}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Contains information about a Denon/Marantz receiver.
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "device_Info")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class Deviceinfo {
-
- private Integer deviceZones;
-
- private String modelName;
-
- public Integer getDeviceZones() {
- return deviceZones;
- }
-
- public void setDeviceZones(Integer deviceZones) {
- this.deviceZones = deviceZones;
- }
-
- public String getModelName() {
- return modelName;
- }
-
- public void setModelName(String modelName) {
- this.modelName = modelName;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.OnOffType;
-
-/**
- * Holds information about the Main zone of the receiver
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "item")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class Main {
-
- private OnOffType power;
-
- public OnOffType getPower() {
- return power;
- }
-
- public void setPower(OnOffType power) {
- this.power = power;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.OnOffType;
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.StringType;
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.VolumeType;
-
-/**
- * Holds information about the secondary zones of the receiver
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "item")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ZoneStatus {
-
- private OnOffType power;
-
- @XmlElementWrapper(name = "inputFuncList")
- @XmlElement(name = "value")
- private List<String> inputFunctions;
-
- private StringType inputFuncSelect;
-
- private StringType volumeDisplay;
-
- private StringType surrMode;
-
- private VolumeType masterVolume;
-
- private OnOffType mute;
-
- public OnOffType getPower() {
- return power;
- }
-
- public void setPower(OnOffType power) {
- this.power = power;
- }
-
- public StringType getInputFuncSelect() {
- return inputFuncSelect;
- }
-
- public void setInputFuncSelect(StringType inputFuncSelect) {
- this.inputFuncSelect = inputFuncSelect;
- }
-
- public StringType getVolumeDisplay() {
- return volumeDisplay;
- }
-
- public void setVolumeDisplay(StringType volumeDisplay) {
- this.volumeDisplay = volumeDisplay;
- }
-
- public StringType getSurrMode() {
- return surrMode;
- }
-
- public void setSurrMode(StringType surrMode) {
- this.surrMode = surrMode;
- }
-
- public VolumeType getMasterVolume() {
- return masterVolume;
- }
-
- public void setMasterVolume(VolumeType masterVolume) {
- this.masterVolume = masterVolume;
- }
-
- public OnOffType getMute() {
- return mute;
- }
-
- public void setMute(OnOffType mute) {
- this.mute = mute;
- }
-
- public List<String> getInputFuncList() {
- return this.inputFunctions;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.OnOffType;
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.StringType;
-import org.openhab.binding.denonmarantz.internal.xml.entities.types.VolumeType;
-
-/**
- * Holds limited information about the secondary zones of the receiver
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "item")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ZoneStatusLite {
-
- private OnOffType power;
-
- private StringType inputFuncSelect;
-
- private StringType volumeDisplay;
-
- private VolumeType masterVolume;
-
- private OnOffType mute;
-
- public OnOffType getPower() {
- return power;
- }
-
- public void setPower(OnOffType power) {
- this.power = power;
- }
-
- public StringType getInputFuncSelect() {
- return inputFuncSelect;
- }
-
- public void setInputFuncSelect(StringType inputFuncSelect) {
- this.inputFuncSelect = inputFuncSelect;
- }
-
- public StringType getVolumeDisplay() {
- return volumeDisplay;
- }
-
- public void setVolumeDisplay(StringType volumeDisplay) {
- this.volumeDisplay = volumeDisplay;
- }
-
- public VolumeType getMasterVolume() {
- return masterVolume;
- }
-
- public void setMasterVolume(VolumeType masterVolume) {
- this.masterVolume = masterVolume;
- }
-
- public OnOffType getMute() {
- return mute;
- }
-
- public void setMute(OnOffType mute) {
- this.mute = mute;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Wrapper for a list of {@link CommandTx}
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "tx")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class AppCommandRequest {
-
- @XmlElement(name = "cmd")
- private List<CommandTx> commands = new ArrayList<>();
-
- public AppCommandRequest() {
- }
-
- public List<CommandTx> getCommands() {
- return commands;
- }
-
- public void setCommands(List<CommandTx> commands) {
- this.commands = commands;
- }
-
- public AppCommandRequest add(CommandTx command) {
- commands.add(command);
- return this;
- }
-
- public static AppCommandRequest of(CommandTx command) {
- AppCommandRequest tx = new AppCommandRequest();
- return tx.add(command);
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Response to an {@link AppCommandRequest}, wraps a list of {@link CommandRx}
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "rx")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class AppCommandResponse {
-
- @XmlElement(name = "cmd")
- private List<CommandRx> commands = new ArrayList<>();
-
- public AppCommandResponse() {
- }
-
- public List<CommandRx> getCommands() {
- return commands;
- }
-
- public void setCommands(List<CommandRx> commands) {
- this.commands = commands;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Response to a {@link CommandTx}
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "cmd")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CommandRx {
-
- private String zone1;
-
- private String zone2;
-
- private String zone3;
-
- private String zone4;
-
- private String volume;
-
- private String disptype;
-
- private String dispvalue;
-
- private String mute;
-
- private String type;
-
- @XmlElement(name = "text")
- private List<Text> texts = new ArrayList<>();
-
- @XmlElementWrapper(name = "functionrename")
- @XmlElement(name = "list")
- private List<RenameSourceList> renameSourceLists;
-
- @XmlElementWrapper(name = "functiondelete")
- @XmlElement(name = "list")
- private List<DeletedSourceList> deletedSourceLists;
-
- private String playstatus;
-
- private String playcontents;
-
- private String repeat;
-
- private String shuffle;
-
- private String source;
-
- public CommandRx() {
- }
-
- public String getZone1() {
- return zone1;
- }
-
- public void setZone1(String zone1) {
- this.zone1 = zone1;
- }
-
- public String getZone2() {
- return zone2;
- }
-
- public void setZone2(String zone2) {
- this.zone2 = zone2;
- }
-
- public String getZone3() {
- return zone3;
- }
-
- public void setZone3(String zone3) {
- this.zone3 = zone3;
- }
-
- public String getZone4() {
- return zone4;
- }
-
- public void setZone4(String zone4) {
- this.zone4 = zone4;
- }
-
- public String getVolume() {
- return volume;
- }
-
- public void setVolume(String volume) {
- this.volume = volume;
- }
-
- public String getDisptype() {
- return disptype;
- }
-
- public void setDisptype(String disptype) {
- this.disptype = disptype;
- }
-
- public String getDispvalue() {
- return dispvalue;
- }
-
- public void setDispvalue(String dispvalue) {
- this.dispvalue = dispvalue;
- }
-
- public String getMute() {
- return mute;
- }
-
- public void setMute(String mute) {
- this.mute = mute;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getPlaystatus() {
- return playstatus;
- }
-
- public void setPlaystatus(String playstatus) {
- this.playstatus = playstatus;
- }
-
- public String getPlaycontents() {
- return playcontents;
- }
-
- public void setPlaycontents(String playcontents) {
- this.playcontents = playcontents;
- }
-
- public String getRepeat() {
- return repeat;
- }
-
- public void setRepeat(String repeat) {
- this.repeat = repeat;
- }
-
- public String getShuffle() {
- return shuffle;
- }
-
- public void setShuffle(String shuffle) {
- this.shuffle = shuffle;
- }
-
- public String getSource() {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public String getText(String key) {
- for (Text text : texts) {
- if (text.getId().equals(key)) {
- return text.getValue();
- }
- }
- return null;
- }
-
- public List<RenameSourceList> getRenameSourceLists() {
- return renameSourceLists;
- }
-
- public List<DeletedSourceList> getDeletedSourceLists() {
- return deletedSourceLists;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
-
-/**
- * Individual commands that can be sent to a Denon/Marantz receiver to request specific information.
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "cmd")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CommandTx {
-
- private static final String DEFAULT_ID = "1";
-
- public static final CommandTx CMD_ALL_POWER = of("GetAllZonePowerStatus");
-
- public static final CommandTx CMD_VOLUME_LEVEL = of("GetVolumeLevel");
-
- public static final CommandTx CMD_MUTE_STATUS = of("GetMuteStatus");
-
- public static final CommandTx CMD_SOURCE_STATUS = of("GetSourceStatus");
-
- public static final CommandTx CMD_SURROUND_STATUS = of("GetSurroundModeStatus");
-
- public static final CommandTx CMD_ZONE_NAME = of("GetZoneName");
-
- public static final CommandTx CMD_NET_STATUS = of("GetNetAudioStatus");
-
- public static final CommandTx CMD_RENAME_SOURCE = of("GetRenameSource");
-
- public static final CommandTx CMD_DELETED_SOURCE = of("GetDeletedSource");
-
- @XmlAttribute(name = "id")
- private String id;
-
- @XmlValue
- private String value;
-
- public CommandTx() {
- }
-
- public CommandTx(String value) {
- this.value = value;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public static CommandTx of(String command) {
- CommandTx cmdTx = new CommandTx(command);
- cmdTx.setId(DEFAULT_ID);
- return cmdTx;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Used to unmarshall {@code <list>} items of the {@code <functiondelete>} CommandRX.
- *
- * @author Jan-Willem Veldhuis - Initial contribution
- */
-@XmlRootElement(name = "list")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class DeletedSourceList {
-
- private String name;
-
- private String funcName;
-
- private Integer use;
-
- public String getName() {
- return name;
- }
-
- public String getFuncName() {
- return funcName;
- }
-
- public Integer getUse() {
- return use;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Used to unmarshall {@code <list>} items of the {@code <functionrename>} CommandRX.
- *
- * @author Jan-Willem Veldhuis - Initial contribution
- */
-@XmlRootElement(name = "list")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class RenameSourceList {
-
- private String name;
-
- private String rename;
-
- public String getName() {
- return name;
- }
-
- public String getRename() {
- return rename;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.commands;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
-
-/**
- * Holds text values with a certain id
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlRootElement(name = "text")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class Text {
-
- @XmlAttribute(name = "id")
- private String id;
-
- @XmlValue
- private String value;
-
- public Text() {
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.types;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.openhab.binding.denonmarantz.internal.xml.adapters.OnOffAdapter;
-
-/**
- * Contains an On/Off value in the form of a boolean
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-public class OnOffType {
-
- @XmlJavaTypeAdapter(OnOffAdapter.class)
- private Boolean value;
-
- public Boolean getValue() {
- return value;
- }
-
- public void setValue(Boolean value) {
- this.value = value;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.types;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.openhab.binding.denonmarantz.internal.xml.adapters.StringAdapter;
-
-/**
- * Contains a string value
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-public class StringType {
-
- @XmlJavaTypeAdapter(value = StringAdapter.class)
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2024 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.binding.denonmarantz.internal.xml.entities.types;
-
-import java.math.BigDecimal;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.openhab.binding.denonmarantz.internal.xml.adapters.VolumeAdapter;
-
-/**
- * Contains a volume value (percentage)
- *
- * @author Jeroen Idserda - Initial contribution
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-public class VolumeType {
-
- @XmlJavaTypeAdapter(value = VolumeAdapter.class)
- private BigDecimal value;
-
- public BigDecimal getValue() {
- return value;
- }
-
- public void setValue(BigDecimal value) {
- this.value = value;
- }
-}