added migrated 2.x add-ons

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2020-09-21 01:58:32 +02:00
parent bbf1a7fd29
commit 6df6783b60
11662 changed files with 1302875 additions and 11 deletions

View File

@@ -0,0 +1,39 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
/**
* Helper for loading XML files from classpath.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class ResponseLoader {
public String load(String path) throws IOException {
try (InputStream in = getClass().getResourceAsStream(path)) {
if (in == null) {
return null;
}
return IOUtils.toString(in);
}
}
public String load(String path, String model) throws IOException {
return load(String.format("/%s/%s", model, path));
}
}

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal;
/**
* Constants with model names used in tests.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class TestModels {
public static final String RX_S601D = "RX-S601D";
public static final String RX_V3900 = "RX-V3900";
public static final String HTR_4069 = "HTR-4069";
}

View File

@@ -0,0 +1,120 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.initMocks;
import java.util.List;
import java.util.Optional;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.config.YamahaBridgeConfig;
import org.openhab.binding.yamahareceiver.internal.discovery.ZoneDiscoveryService;
import org.openhab.binding.yamahareceiver.internal.handler.YamahaBridgeHandler;
import org.openhab.binding.yamahareceiver.internal.protocol.ConnectionStateListener;
import org.openhab.binding.yamahareceiver.internal.protocol.DeviceInformation;
import org.openhab.binding.yamahareceiver.internal.protocol.ProtocolFactory;
import org.openhab.binding.yamahareceiver.internal.protocol.SystemControl;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.AbstractXMLProtocolTest;
import org.openhab.core.config.core.Configuration;
import org.openhab.core.thing.Bridge;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusInfo;
import org.openhab.core.thing.binding.ThingHandlerCallback;
/**
* Test cases for {@link YamahaBridgeHandler}. The tests provide mocks for supporting entities using Mockito.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class YamahaReceiverHandlerTest extends AbstractXMLProtocolTest {
private YamahaBridgeHandler subject;
@Mock
private YamahaBridgeConfig bridgeConfig;
@Mock
private Configuration configuration;
@Mock
private ProtocolFactory protocolFactory;
@Mock
private DeviceInformation deviceInformation;
@Mock
private SystemControl systemControl;
@Mock
private ThingHandlerCallback callback;
@Mock
private Bridge bridge;
@Override
protected void onSetUp() throws Exception {
super.onSetUp();
initMocks(this);
ctx.prepareForModel(TestModels.RX_S601D);
ctx.respondWith("<Main_Zone><Input><Input_Sel_Item>GetParam</Input_Sel_Item></Input></Main_Zone>",
"Main_Zone_Input_Input_Sel.xml");
when(bridgeConfig.getHostWithPort()).thenReturn(Optional.of("localhost:80"));
when(bridgeConfig.getInputMapping()).thenReturn("");
when(bridgeConfig.getRefreshInterval()).thenReturn(10);
when(configuration.as(YamahaBridgeConfig.class)).thenReturn(bridgeConfig);
when(bridge.getConfiguration()).thenReturn(configuration);
when(protocolFactory.DeviceInformation(any(), any())).thenReturn(deviceInformation);
when(protocolFactory.SystemControl(any(), any(), any())).thenReturn(systemControl);
subject = new YamahaBridgeHandler(bridge);
subject.setZoneDiscoveryService(mock(ZoneDiscoveryService.class));
subject.setProtocolFactory(protocolFactory);
subject.setCallback(callback);
doAnswer(a -> {
((ConnectionStateListener) a.getArgument(1)).onConnectionCreated(ctx.getConnection());
return null;
}).when(protocolFactory).createConnection(anyString(), same(subject));
}
@Test
public void afterInitializeBridgeShouldBeOnline() throws InterruptedException {
// when
subject.initialize();
// internally there is an timer, let's allow it to execute
Thread.sleep(200);
// then
ArgumentCaptor<ThingStatusInfo> statusInfoCaptor = ArgumentCaptor.forClass(ThingStatusInfo.class);
verify(callback, atLeastOnce()).statusUpdated(same(bridge), statusInfoCaptor.capture());
List<ThingStatusInfo> thingStatusInfo = statusInfoCaptor.getAllValues();
// the first one will be OFFLINE
assertThat(thingStatusInfo.get(0).getStatus(), is(equalTo(ThingStatus.OFFLINE)));
// depending on the internal timer, several status updates and especially the last one will be ONLINE
assertThat(thingStatusInfo.get(thingStatusInfo.size() - 1).getStatus(), is(equalTo(ThingStatus.ONLINE)));
}
}

View File

@@ -0,0 +1,91 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Zone.Zone_2;
import java.io.IOException;
import org.junit.Test;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.config.YamahaZoneConfig;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.AbstractXMLProtocolTest;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.DeviceInformationXML;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.XMLProtocolFactory;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.ZoneBControlXML;
import org.openhab.binding.yamahareceiver.internal.protocol.xml.ZoneControlXML;
import org.openhab.binding.yamahareceiver.internal.state.DeviceInformationState;
import org.openhab.binding.yamahareceiver.internal.state.ZoneControlStateListener;
/**
* Unit test for {@link ProtocolFactory}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class XMLProtocolFactoryTest extends AbstractXMLProtocolTest {
@Mock
private YamahaZoneConfig zoneConfig;
@Mock
private ZoneControlStateListener zoneControlStateListener;
private DeviceInformationState state = new DeviceInformationState();
private XMLProtocolFactory subject;
@Override
protected void onSetUp() throws Exception {
super.onSetUp();
when(zoneConfig.getZone()).thenReturn(Zone_2);
when(con.sendReceive(eq("<Zone_2><Basic_Status>GetParam</Basic_Status></Zone_2>"))).thenReturn("<xml></xml>");
subject = new XMLProtocolFactory();
}
@Test
public void given_HTR4069_with_ZONEB_then_Zone2_control_is_ZoneBControlXML()
throws IOException, ReceivedMessageParseException {
// arrange
ctx.prepareForModel("HTR-4069");
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, state);
deviceInformation.update();
// act
ZoneControl zoneControl = subject.ZoneControl(con, zoneConfig, zoneControlStateListener, () -> null, state);
// assert
assertTrue("Created ZoneB control", zoneControl instanceof ZoneBControlXML);
}
@Test
public void given_RXS601D_without_ZONEB_then_Zone2_control_is_ZoneControlXML()
throws IOException, ReceivedMessageParseException {
// arrange
ctx.prepareForModel("RX-S601D");
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, state);
deviceInformation.update();
// act
ZoneControl zoneControl = subject.ZoneControl(con, zoneConfig, zoneControlStateListener, () -> null, state);
// assert
assertTrue("Created Zone control", zoneControl instanceof ZoneControlXML);
}
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.mockito.Mock;
/**
* Baseline for tests for the XML protocol implementation.
*
* @author Tomasz Maruszak - Initial contribution
*/
public abstract class AbstractXMLProtocolTest {
@Mock
protected XMLConnection con;
protected ModelContext ctx;
@Before
public void setUp() throws Exception {
initMocks(this);
ctx = new ModelContext(con);
onSetUp();
}
protected void onSetUp() throws Exception {
}
}

View File

@@ -0,0 +1,54 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.when;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.config.YamahaZoneConfig;
import org.openhab.binding.yamahareceiver.internal.protocol.InputConverter;
import org.openhab.binding.yamahareceiver.internal.state.DeviceInformationState;
import org.openhab.binding.yamahareceiver.internal.state.ZoneControlStateListener;
/**
* Common zone test.
*
* @author Tomasz Maruszak - Initial contribution
*/
public abstract class AbstractZoneControlXMLTest extends AbstractXMLProtocolTest {
@Mock
protected YamahaZoneConfig zoneConfig;
@Mock
protected ZoneControlStateListener zoneControlStateListener;
protected DeviceInformationState deviceInformationState;
@Mock
protected InputConverter inputConverter;
@Override
protected void onSetUp() throws Exception {
super.onSetUp();
deviceInformationState = new DeviceInformationState();
when(zoneConfig.getVolumeDbMin()).thenReturn(-10f);
when(zoneConfig.getVolumeDbMax()).thenReturn(10f);
when(inputConverter.fromStateName(anyString())).thenAnswer(p -> p.getArgument(0));
when(inputConverter.toCommandName(anyString())).thenAnswer(p -> p.getArgument(0));
}
}

View File

@@ -0,0 +1,123 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Feature.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Zone.*;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.junit.Test;
import org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants;
/**
* Unit test for {@link DeviceDescriptorXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class DeviceDescriptorXMLTest extends AbstractXMLProtocolTest {
@Test
public void given_RXS601D_parsesDescriptor() throws IOException {
parsesDescriptor("RX-S601D", Arrays.asList(Main_Zone, Zone_2),
Arrays.asList(AIRPLAY, SPOTIFY, USB, BLUETOOTH, DAB, NET_RADIO),
new CommandsSpec(9,
Arrays.asList("System,Power_Control,Power", "System,Party_Mode,Mode",
"System,Party_Mode,Volume,Lvl", "System,Party_Mode,Volume,Mute")),
new CommandsSpec[] {
// Main_Zone
new CommandsSpec(29, Arrays.asList("Main_Zone,Power_Control,Power", "Main_Zone,Volume,Lvl",
"Main_Zone,Volume,Mute", "Main_Zone,Input,Input_Sel", "Main_Zone,Input,Input_Sel_Item",
"Main_Zone,Scene,Scene_Sel", "Main_Zone,Scene,Scene_Sel_Item",
"Main_Zone,Surround,Program_Sel,Current,Straight",
"Main_Zone,Surround,Program_Sel,Current,Enhancer",
"Main_Zone,Surround,Program_Sel,Current,Sound_Program")),
// Zone_2
new CommandsSpec(20,
Arrays.asList("Zone_2,Power_Control,Power", "Zone_2,Volume,Lvl", "Zone_2,Volume,Mute",
"Zone_2,Input,Input_Sel", "Zone_2,Input,Input_Sel_Item",
"Zone_2,Scene,Scene_Sel", "Zone_2,Scene,Scene_Sel_Item")) });
}
@Test
public void given_RXV3900_parsesDescriptor() throws IOException {
parsesDescriptor("RX-V3900", Arrays.asList(Main_Zone, Zone_2, Zone_3), Arrays.asList(BLUETOOTH, TUNER, NET_USB),
new CommandsSpec(2, Arrays.asList("System,Power_Control,Power")), new CommandsSpec[] {
// Main_Zone
new CommandsSpec(9, Arrays.asList("Main_Zone,Power_Control,Power", "Main_Zone,Vol,Lvl",
"Main_Zone,Vol,Mute", "Main_Zone,Input,Input_Sel", "Main_Zone,Input,Input_Sel_Item")),
// Zone_2
new CommandsSpec(9,
Arrays.asList("Zone_2,Power_Control,Power", "Zone_2,Vol,Lvl", "Zone_2,Vol,Mute",
"Zone_2,Input,Input_Sel", "Zone_2,Input,Input_Sel_Item")),
// Zone_3
new CommandsSpec(9, Arrays.asList("Zone_3,Power_Control,Power", "Zone_3,Vol,Lvl",
"Zone_3,Vol,Mute", "Zone_3,Input,Input_Sel", "Zone_3,Input,Input_Sel_Item")) });
}
private void parsesDescriptor(String model, List<YamahaReceiverBindingConstants.Zone> zones,
Collection<YamahaReceiverBindingConstants.Feature> features, CommandsSpec systemCommandsSpec,
CommandsSpec[] zonesCommandsSpec) throws IOException {
// arrange
ctx.prepareForModel(model);
DeviceDescriptorXML subject = new DeviceDescriptorXML();
// act
subject.load(con);
// assert
assertEquals(model, subject.getUnitName());
assertNotNull(subject.system);
assertCommands(subject.system, systemCommandsSpec);
assertNotNull(subject.features);
assertTrue("Desired features present", subject.features.keySet().containsAll(features));
assertNotNull(subject.zones);
assertEquals("Number of zones match", zones.size(), subject.zones.size());
for (int i = 0; i < zones.size(); i++) {
YamahaReceiverBindingConstants.Zone zone = zones.get(i);
assertTrue("Desired zone is present", subject.zones.containsKey(zone));
DeviceDescriptorXML.ZoneDescriptor zoneDesc = subject.zones.get(zone);
CommandsSpec zoneSpec = zonesCommandsSpec[i];
assertCommands(zoneDesc, zoneSpec);
}
}
private void assertCommands(DeviceDescriptorXML.HasCommands descWithCommands, CommandsSpec spec) {
assertNotNull("Descriptor commands are present", descWithCommands);
assertEquals("Expected number of commands", spec.expectedNumber, descWithCommands.commands.size());
assertTrue("Expected commands are present", descWithCommands.commands.containsAll(spec.expected));
}
private static class CommandsSpec {
private final int expectedNumber;
private final Collection<String> expected;
private CommandsSpec(int expectedNumber, Collection<String> expected) {
this.expectedNumber = expectedNumber;
this.expected = expected;
}
}
}

View File

@@ -0,0 +1,70 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertTrue;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Feature.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Zone.*;
import java.io.IOException;
import java.util.Arrays;
import org.junit.Test;
import org.openhab.binding.yamahareceiver.internal.protocol.ReceivedMessageParseException;
import org.openhab.binding.yamahareceiver.internal.state.DeviceInformationState;
/**
* Unit test for {@link DeviceInformationXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class DeviceInformationXMLTest extends AbstractXMLProtocolTest {
private DeviceInformationState state;
private DeviceInformationXML subject;
@Override
public void onSetUp() {
state = new DeviceInformationState();
subject = new DeviceInformationXML(con, state);
}
@Test
public void when_HTR4069_then_detects_featureZoneB_and_addsZone2()
throws IOException, ReceivedMessageParseException {
// arrange
ctx.prepareForModel("HTR-4069");
// act
subject.update();
// assert
assertTrue("ZONE_B detected", state.features.contains(ZONE_B));
assertTrue("Zone_2 added", state.zones.contains(Zone_2));
}
@Test
public void when_RXV3900_then_detects_features_and_zones_from_descriptor()
throws IOException, ReceivedMessageParseException {
// arrange
ctx.prepareForModel("RX-V3900");
// act
subject.update();
// assert
assertTrue("Zones detected", state.zones.containsAll(Arrays.asList(Main_Zone, Zone_2, Zone_3)));
assertTrue("Features detected", state.features.containsAll(Arrays.asList(TUNER, BLUETOOTH)));
}
}

View File

@@ -0,0 +1,88 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertEquals;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
import static org.openhab.binding.yamahareceiver.internal.protocol.xml.XMLConstants.Commands.ZONE_INPUT_QUERY;
import org.junit.Test;
/**
* Unit test for {@link InputConverterXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class InputConverterXMLTest extends AbstractXMLProtocolTest {
private InputConverterXML subject;
@Override
protected void onSetUp() throws Exception {
super.onSetUp();
ctx.prepareForModel("HTR-4069");
ctx.respondWith(String.format("<Main_Zone>%s</Main_Zone>", ZONE_INPUT_QUERY),
"Main_Zone_Input_Input_Sel_Item.xml");
}
@Test
public void when_noMapping_fromStateName_returnsCanonicalNames() {
// arrange
subject = new InputConverterXML(con, "");
// act
String hdmi1 = subject.fromStateName("HDMI1");
String hdmi2 = subject.fromStateName("HDMI2");
String av1 = subject.fromStateName("AV1");
String av2 = subject.fromStateName("AV2");
String audio1 = subject.fromStateName("AUDIO1");
String audio2 = subject.fromStateName("AUDIO2");
String bluetooth = subject.fromStateName(INPUT_BLUETOOTH);
String usb = subject.fromStateName(INPUT_USB);
String tuner = subject.fromStateName(INPUT_TUNER);
String netRadio = subject.fromStateName(INPUT_NET_RADIO);
String server = subject.fromStateName(INPUT_SERVER);
String multiCastLink = subject.fromStateName(INPUT_MUSIC_CAST_LINK);
String spotify = subject.fromStateName(INPUT_SPOTIFY);
// assert
assertEquals("HDMI1", hdmi1);
assertEquals("HDMI2", hdmi2);
assertEquals("AV1", av1);
assertEquals("AV2", av2);
assertEquals("AUDIO1", audio1);
assertEquals("AUDIO2", audio2);
assertEquals("Bluetooth", bluetooth);
assertEquals("USB", usb);
assertEquals("TUNER", tuner);
assertEquals("NET RADIO", netRadio);
assertEquals("SERVER", server);
assertEquals("MusicCast Link", multiCastLink);
assertEquals("Spotify", spotify);
}
@Test
public void when_mapping_fromStateName_takesUserMappingAboveAll() {
// arrange
subject = new InputConverterXML(con, "HDMI1=HDMI 1,Bluetooth=BLUETOOTH");
// act
String hdmi1 = subject.fromStateName("HDMI1");
String bluetooth = subject.fromStateName(INPUT_BLUETOOTH);
// assert
assertEquals("HDMI 1", hdmi1);
assertEquals("BLUETOOTH", bluetooth);
}
}

View File

@@ -0,0 +1,285 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.openhab.binding.yamahareceiver.internal.TestModels.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
import java.util.function.Consumer;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.config.YamahaBridgeConfig;
import org.openhab.binding.yamahareceiver.internal.state.PlayInfoState;
import org.openhab.binding.yamahareceiver.internal.state.PlayInfoStateListener;
/**
* Unit test for {@link InputWithPlayControlXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class InputWithPlayControlXMLTest extends AbstractZoneControlXMLTest {
private InputWithPlayControlXML subject;
@Mock
private PlayInfoStateListener playInfoStateListener;
@Captor
private ArgumentCaptor<PlayInfoState> playInfoStateArg;
@Mock
private YamahaBridgeConfig bridgeConfig;
private String albumUrl;
private void given(String model, String input, Consumer<ModelContext> setup) throws Exception {
ctx.prepareForModel(model);
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, deviceInformationState);
deviceInformation.update();
setup.accept(ctx);
albumUrl = "http://some/url.jpg";
when(bridgeConfig.getAlbumUrl()).thenReturn(albumUrl);
subject = new InputWithPlayControlXML(input, con, playInfoStateListener, bridgeConfig, deviceInformationState);
}
@Test
public void given_RX_S601D_and_Spotify_when_playStopPause_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_SPOTIFY, ctx -> {
ctx.respondWith("<Spotify><Play_Info>GetParam</Play_Info></Spotify>", "Spotify_Play_Info.xml");
});
// when
subject.play();
subject.stop();
subject.pause();
// then
verify(con).send(eq("<Spotify><Play_Control><Playback>Play</Playback></Play_Control></Spotify>"));
verify(con).send(eq("<Spotify><Play_Control><Playback>Stop</Playback></Play_Control></Spotify>"));
verify(con).send(eq("<Spotify><Play_Control><Playback>Pause</Playback></Play_Control></Spotify>"));
}
@Test
public void given_RX_S601D_and_Spotify_when_nextPrevious_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_SPOTIFY, ctx -> {
ctx.respondWith("<Spotify><Play_Info>GetParam</Play_Info></Spotify>", "Spotify_Play_Info.xml");
});
// when
subject.nextTrack();
subject.previousTrack();
// then
verify(con).send(eq("<Spotify><Play_Control><Playback>Skip Fwd</Playback></Play_Control></Spotify>"));
verify(con).send(eq("<Spotify><Play_Control><Playback>Skip Rev</Playback></Play_Control></Spotify>"));
}
@Test
public void given_RX_S601D_and_Bluetooth_when_playStopPause_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_BLUETOOTH, ctx -> {
ctx.respondWith("<Bluetooth><Play_Info>GetParam</Play_Info></Bluetooth>", "Bluetooth_Play_Info.xml");
});
// when
subject.play();
subject.stop();
subject.pause();
// then
verify(con).send(eq("<Bluetooth><Play_Control><Playback>Play</Playback></Play_Control></Bluetooth>"));
verify(con).send(eq("<Bluetooth><Play_Control><Playback>Stop</Playback></Play_Control></Bluetooth>"));
verify(con).send(eq("<Bluetooth><Play_Control><Playback>Pause</Playback></Play_Control></Bluetooth>"));
}
@Test
public void given_RX_S601D_and_Bluetooth_when_nextPrevious_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_BLUETOOTH, ctx -> {
ctx.respondWith("<Bluetooth><Play_Info>GetParam</Play_Info></Bluetooth>", "Bluetooth_Play_Info.xml");
});
// when
subject.nextTrack();
subject.previousTrack();
// then
verify(con).send(eq("<Bluetooth><Play_Control><Playback>Skip Fwd</Playback></Play_Control></Bluetooth>"));
verify(con).send(eq("<Bluetooth><Play_Control><Playback>Skip Rev</Playback></Play_Control></Bluetooth>"));
}
@Test
public void given_RX_S601D_and_NET_RADIO_when_nextPrevious_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_NET_RADIO, ctx -> {
ctx.respondWith("<NET_RADIO><Play_Info>GetParam</Play_Info></NET_RADIO>", "NET_RADIO_Play_Info.xml");
});
// when
subject.nextTrack();
subject.previousTrack();
// then
verify(con).send(eq("<NET_RADIO><Play_Control><Playback>Skip Fwd</Playback></Play_Control></NET_RADIO>"));
verify(con).send(eq("<NET_RADIO><Play_Control><Playback>Skip Rev</Playback></Play_Control></NET_RADIO>"));
}
@Test
public void given_RX_S601D_and_Spotify_when_update_then_stateIsProperlyRead() throws Exception {
given(RX_S601D, INPUT_SPOTIFY, ctx -> {
ctx.respondWith("<Spotify><Play_Info>GetParam</Play_Info></Spotify>", "Spotify_Play_Info.xml");
});
ArgumentCaptor<PlayInfoState> playInfoStateArg = ArgumentCaptor.forClass(PlayInfoState.class);
// when
subject.update();
// then
verify(playInfoStateListener).playInfoUpdated(playInfoStateArg.capture());
PlayInfoState state = playInfoStateArg.getValue();
assertEquals("Play", state.playbackMode);
assertEquals("Above & Beyond", state.artist);
assertEquals("Acoustic - Live At The Hollywood Bowl", state.album);
assertEquals("No One On Earth - Live At The Hollywood Bowl", state.song);
assertEquals("N/A", state.station);
assertEquals("http://localhost/YamahaRemoteControl/AlbumART/AlbumART6585.jpg", state.songImageUrl);
}
@Test
public void given_RX_S601D_and_NET_RADIO_when_update_then_stateIsProperlyRead() throws Exception {
given(RX_S601D, INPUT_NET_RADIO, ctx -> {
ctx.respondWith("<NET_RADIO><Play_Info>GetParam</Play_Info></NET_RADIO>", "NET_RADIO_Play_Info.xml");
});
// when
subject.update();
// then
verify(playInfoStateListener).playInfoUpdated(playInfoStateArg.capture());
PlayInfoState state = playInfoStateArg.getValue();
assertEquals("Play", state.playbackMode);
assertEquals("N/A", state.artist);
assertEquals("Chilli ZET PL", state.station);
assertEquals("", state.album);
assertEquals("LESZEK MOZDZER - ZDROWY KOLATAJ", state.song);
assertEquals("http://localhost/YamahaRemoteControl/AlbumART/AlbumART4626.jpg", state.songImageUrl);
}
@Test
public void given_RX_S601D_and_Bluetooth_when_update_then_stateIsProperlyRead() throws Exception {
given(RX_S601D, INPUT_BLUETOOTH, ctx -> {
ctx.respondWith("<Bluetooth><Play_Info>GetParam</Play_Info></Bluetooth>", "Bluetooth_Play_Info.xml");
});
ArgumentCaptor<PlayInfoState> playInfoStateArg = ArgumentCaptor.forClass(PlayInfoState.class);
// when
subject.update();
// then
verify(playInfoStateListener).playInfoUpdated(playInfoStateArg.capture());
PlayInfoState state = playInfoStateArg.getValue();
assertEquals("Play", state.playbackMode);
assertEquals("M.I.K.E.", state.artist);
assertEquals("A State Of Trance Classics, Vol. 12 (The Full Unmixed Versions)", state.album);
assertEquals("Voices From The Inside", state.song);
assertEquals("N/A", state.station);
assertEquals(albumUrl, state.songImageUrl);
}
@Test
public void given_RX_V3900_and_NET_RADIO_when_playStopPause_then_sendsProperCommand() throws Exception {
given(RX_V3900, INPUT_NET_RADIO, ctx -> {
ctx.respondWith("<NET_USB><Play_Info>GetParam</Play_Info></NET_USB>", "NET_USB_Play_Info.xml");
});
// when
subject.play();
subject.stop();
subject.pause();
// then
verify(con).send(eq("<NET_USB><Play_Control><Play>Play</Play></Play_Control></NET_USB>"));
verify(con).send(eq("<NET_USB><Play_Control><Play>Stop</Play></Play_Control></NET_USB>"));
verify(con).send(eq("<NET_USB><Play_Control><Play>Pause</Play></Play_Control></NET_USB>"));
}
@Test
public void given_RX_V3900_and_NET_RADIO_when_nextPrevious_then_sendsProperCommand() throws Exception {
given(RX_V3900, INPUT_NET_RADIO, ctx -> {
ctx.respondWith("<NET_USB><Play_Info>GetParam</Play_Info></NET_USB>", "NET_USB_Play_Info.xml");
});
// when
subject.nextTrack();
subject.previousTrack();
// then
verify(con).send(eq("<NET_USB><Play_Control><Skip>Fwd</Skip></Play_Control></NET_USB>"));
verify(con).send(eq("<NET_USB><Play_Control><Skip>Rev</Skip></Play_Control></NET_USB>"));
}
@Test
public void given_RX_V3900_and_NET_RADIO_when_update_then_stateIsProperlyRead() throws Exception {
given(RX_V3900, INPUT_NET_RADIO, ctx -> {
ctx.respondWith("<NET_USB><Play_Info>GetParam</Play_Info></NET_USB>", "NET_USB_Play_Info.xml");
});
// when
subject.update();
// then
verify(playInfoStateListener).playInfoUpdated(playInfoStateArg.capture());
PlayInfoState state = playInfoStateArg.getValue();
assertEquals("Play", state.playbackMode);
assertEquals("Some Artist", state.artist);
assertEquals("Some Album", state.album);
assertEquals("SuomiPOP 98.1", state.song);
assertEquals("N/A", state.station);
assertEquals(albumUrl, state.songImageUrl);
}
@Test
public void given_RX_V3900_and_TUNER_when_update_then_stateIsProperlyRead() throws Exception {
given(RX_V3900, INPUT_TUNER, ctx -> {
ctx.respondWith("<Tuner><Play_Info>GetParam</Play_Info></Tuner>", "Tuner_Play_Info.xml");
});
// when
subject.update();
// then
verify(playInfoStateListener).playInfoUpdated(playInfoStateArg.capture());
PlayInfoState state = playInfoStateArg.getValue();
assertEquals("Stop", state.playbackMode);
assertEquals("", state.artist);
assertEquals("POP_M", state.album);
assertEquals("", state.song);
assertEquals("SUOMIPOP", state.station);
assertEquals(albumUrl, state.songImageUrl);
}
}

View File

@@ -0,0 +1,150 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.openhab.binding.yamahareceiver.internal.TestModels.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
import java.util.function.Consumer;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.state.PresetInfoState;
import org.openhab.binding.yamahareceiver.internal.state.PresetInfoStateListener;
/**
* Unit test for {@link InputWithPresetControlXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class InputWithPresetControlXMLTest extends AbstractZoneControlXMLTest {
private InputWithPresetControlXML subject;
@Mock
private PresetInfoStateListener presetInfoStateListener;
@Captor
private ArgumentCaptor<PresetInfoState> presetInfoStateArg;
private void given(String model, String input, Consumer<ModelContext> setup) throws Exception {
ctx.prepareForModel(model);
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, deviceInformationState);
deviceInformation.update();
setup.accept(ctx);
subject = new InputWithPresetControlXML(input, con, presetInfoStateListener, deviceInformationState);
}
@Test
public void given_RX_S601D_and_NET_RADIO_when_preset1_then_sendsProperCommand() throws Exception {
given(RX_S601D, INPUT_NET_RADIO, ctx -> {
ctx.respondWith(
"<NET_RADIO><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></NET_RADIO>",
"NET_RADIO_Play_Control_Preset_Preset_Sel_Item.xml");
ctx.respondWith(
"<NET_RADIO><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></NET_RADIO>",
"NET_RADIO_Play_Control_Preset_Preset_Sel.xml");
});
// when
subject.selectItemByPresetNumber(1);
// then
verify(presetInfoStateListener).presetInfoUpdated(presetInfoStateArg.capture());
PresetInfoState state = presetInfoStateArg.getValue();
verify(con).send(
eq("<NET_RADIO><Play_Control><Preset><Preset_Sel>1</Preset_Sel></Preset></Play_Control></NET_RADIO>"));
assertEquals("1 : NET RADIO Chilli ZET PL", state.presetChannelNames.get(0).getName());
assertEquals(1, state.presetChannelNames.get(0).getValue());
assertEquals("2 : NET RADIO Polskie Radio 24", state.presetChannelNames.get(1).getName());
assertEquals(2, state.presetChannelNames.get(1).getValue());
}
@Test
public void given_RX_V3900_and_NET_RADIO_when_preset1_then_sendsProperCommand() throws Exception {
given(RX_V3900, INPUT_NET_RADIO, ctx -> {
ctx.respondWith(
"<NET_USB><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></NET_USB>",
"NET_USB_Play_Control_Preset_Preset_Sel_Item.xml");
ctx.respondWith(
"<NET_USB><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></NET_USB>",
"NET_USB_Play_Control_Preset_Preset_Sel.xml");
});
// when
subject.selectItemByPresetNumber(1);
// then
verify(con).send(
eq("<NET_USB><Play_Control><Preset><Preset_Sel>1</Preset_Sel></Preset></Play_Control></NET_USB>"));
}
@Test
public void given_RX_V3900_and_TUNER_when_preset1_then_sendsProperCommand() throws Exception {
given(RX_V3900, INPUT_TUNER, ctx -> {
ctx.respondWith(
"<Tuner><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></Tuner>",
"Tuner_Play_Control_Preset_Preset_Sel_Item.xml");
ctx.respondWith(
"<Tuner><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></Tuner>",
"Tuner_Play_Control_Preset_Preset_Sel.xml");
});
// when
subject.selectItemByPresetNumber(101);
subject.selectItemByPresetNumber(212);
// then
verify(con)
.send(eq("<Tuner><Play_Control><Preset><Preset_Sel>A1</Preset_Sel></Preset></Play_Control></Tuner>"));
verify(con)
.send(eq("<Tuner><Play_Control><Preset><Preset_Sel>B12</Preset_Sel></Preset></Play_Control></Tuner>"));
}
@Test
public void given_RX_V3900_and_TUNER_when_update_then_populatesStateCorrectly() throws Exception {
given(RX_V3900, INPUT_TUNER, ctx -> {
ctx.respondWith(
"<Tuner><Play_Control><Preset><Preset_Sel_Item>GetParam</Preset_Sel_Item></Preset></Play_Control></Tuner>",
"Tuner_Play_Control_Preset_Preset_Sel_Item.xml");
ctx.respondWith(
"<Tuner><Play_Control><Preset><Preset_Sel>GetParam</Preset_Sel></Preset></Play_Control></Tuner>",
"Tuner_Play_Control_Preset_Preset_Sel.xml");
});
// when
subject.update();
// then
verify(presetInfoStateListener).presetInfoUpdated(presetInfoStateArg.capture());
PresetInfoState state = presetInfoStateArg.getValue();
// A1
assertEquals(101, state.presetChannel);
assertEquals(16, state.presetChannelNames.size());
assertEquals("A1", state.presetChannelNames.get(0).getName());
assertEquals(101, state.presetChannelNames.get(0).getValue());
assertEquals("A2", state.presetChannelNames.get(1).getName());
assertEquals(102, state.presetChannelNames.get(1).getValue());
}
}

View File

@@ -0,0 +1,70 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import static org.openhab.binding.yamahareceiver.internal.protocol.xml.XMLConstants.Commands.SYSTEM_STATUS_CONFIG_CMD;
import static org.openhab.binding.yamahareceiver.internal.protocol.xml.XMLConstants.Commands.ZONE_BASIC_STATUS_CMD;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.openhab.binding.yamahareceiver.internal.ResponseLoader;
/**
* Testing context for a selected Yamaha model.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class ModelContext {
private final ResponseLoader rl = new ResponseLoader();
private final XMLConnection connection;
private String model;
public XMLConnection getConnection() {
return connection;
}
public ModelContext(XMLConnection connection) {
this.connection = connection;
}
public void prepareForModel(String model) throws IOException {
this.model = model;
String descFile = String.format("/desc_%s.xml", model);
String desc = rl.load(descFile, model);
if (desc == null) {
throw new FileNotFoundException("Could not load " + descFile);
}
when(connection.getResponse(eq("/YamahaRemoteControl/desc.xml"))).thenReturn(desc);
when(connection.getHost()).thenReturn("localhost");
respondWith(SYSTEM_STATUS_CONFIG_CMD, "System_Config.xml");
respondWith(String.format("<Main_Zone>%s</Main_Zone>", ZONE_BASIC_STATUS_CMD), "Main_Zone_Basic_Status.xml");
}
public void respondWith(String command, String path) {
try {
String response = rl.load(path, model);
if (response != null) {
when(connection.sendReceive(eq(command))).thenReturn(response);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -0,0 +1,121 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.openhab.binding.yamahareceiver.internal.TestModels;
import org.openhab.binding.yamahareceiver.internal.state.DeviceInformationState;
import org.openhab.binding.yamahareceiver.internal.state.SystemControlState;
import org.openhab.binding.yamahareceiver.internal.state.SystemControlStateListener;
/**
* Unit test for {@link SystemControlXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class SystemControlXMLTest extends AbstractXMLProtocolTest {
private SystemControlXML subject;
private DeviceInformationState deviceInformationState;
@Mock
private SystemControlStateListener systemControlStateListener;
protected void setupFor(String model) throws Exception {
ctx.prepareForModel(model);
ctx.respondWith("<System><Power_Control><Power>GetParam</Power></Power_Control></System>",
"System_Power_Control_Power.xml");
ctx.respondWith("<System><Party_Mode><Mode>GetParam</Mode></Party_Mode></System>",
"System_Party_Mode_Mode.xml");
deviceInformationState = new DeviceInformationState();
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, deviceInformationState);
deviceInformation.update();
subject = new SystemControlXML(con, systemControlStateListener, deviceInformationState);
}
@Test
public void given_RX_S601D_when_update_then_parsesState() throws Exception {
// given
setupFor(TestModels.RX_S601D);
// when
subject.update();
// then
ArgumentCaptor<SystemControlState> stateArg = ArgumentCaptor.forClass(SystemControlState.class);
verify(systemControlStateListener, only()).systemControlStateChanged(stateArg.capture());
SystemControlState state = stateArg.getValue();
assertTrue(state.power);
assertTrue(state.partyMode);
}
@Test
public void given_RX_S601D_when_power_then_sendsProperCommand() throws Exception {
// given
setupFor(TestModels.RX_S601D);
// when
subject.setPower(true);
subject.setPower(false);
subject.setPartyMode(true);
subject.setPartyModeMute(true);
// then
verify(con).send(eq("<System><Power_Control><Power>On</Power></Power_Control></System>"));
verify(con).send(eq("<System><Power_Control><Power>Standby</Power></Power_Control></System>"));
verify(con).send(eq("<System><Party_Mode><Mode>On</Mode></Party_Mode></System>"));
verify(con).send(eq("<System><Party_Mode><Volume><Mute>On</Mute></Volume></Party_Mode></System>"));
}
@Test
public void given_RX_V3900_when_partyMode_then_noCommandSend() throws Exception {
// given
setupFor(TestModels.RX_V3900);
// when
subject.setPartyMode(true);
subject.setPartyModeMute(true);
subject.setPartyModeVolume(true);
// then
verify(con, never()).send(anyString());
}
@Test
public void given_RX_V3900_when_update_then_parsesStateAndDoesNotUpdateStateForPartyMode() throws Exception {
// given
setupFor(TestModels.RX_V3900);
// when
subject.update();
// then
ArgumentCaptor<SystemControlState> stateArg = ArgumentCaptor.forClass(SystemControlState.class);
verify(systemControlStateListener, only()).systemControlStateChanged(stateArg.capture());
verify(con, never()).sendReceive(eq("<System><Party_Mode><Mode>GetParam</Mode></Party_Mode></System>"));
SystemControlState state = stateArg.getValue();
assertTrue(state.power);
assertFalse(state.partyMode);
}
}

View File

@@ -0,0 +1,106 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.openhab.binding.yamahareceiver.internal.TestModels.HTR_4069;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.openhab.binding.yamahareceiver.internal.state.ZoneControlState;
/**
* Unit test for {@link ZoneBControlXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class ZoneBControlXMLTest extends AbstractZoneControlXMLTest {
private ZoneBControlXML subject;
private void given(String model) throws Exception {
ctx.prepareForModel(model);
when(con.sendReceive(eq("<Zone_2><Basic_Status>GetParam</Basic_Status></Zone_2>"))).thenReturn("<xml></xml>");
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, deviceInformationState);
deviceInformation.update();
subject = new ZoneBControlXML(con, zoneConfig, zoneControlStateListener, deviceInformationState,
() -> inputConverter);
}
@Test
public void given_HTR_4069_when_power_then_sendsProperCommand() throws Exception {
given(HTR_4069);
// when
subject.setPower(true);
subject.setPower(false);
// then
verify(con).send(eq("<Main_Zone><Power_Control><Zone_B_Power>On</Zone_B_Power></Power_Control></Main_Zone>"));
verify(con)
.send(eq("<Main_Zone><Power_Control><Zone_B_Power>Standby</Zone_B_Power></Power_Control></Main_Zone>"));
}
@Test
public void given_HTR_4069_when_mute_then_sendsProperCommand() throws Exception {
given(HTR_4069);
// when
subject.setMute(true);
subject.setMute(false);
// then
verify(con).send(eq("<Main_Zone><Volume><Zone_B><Mute>On</Mute></Zone_B></Volume></Main_Zone>"));
verify(con).send(eq("<Main_Zone><Volume><Zone_B><Mute>Off</Mute></Zone_B></Volume></Main_Zone>"));
}
@Test
public void given_HTR_4069_when_volume_then_sendsProperCommand() throws Exception {
given(HTR_4069);
// when
subject.setVolumeDB(-2);
// then
verify(con).send(eq(
"<Main_Zone><Volume><Zone_B><Lvl><Val>-20</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Zone_B></Volume></Main_Zone>"));
}
@Test
public void given_HTR_4069_when_update_then_readsStateProperly() throws Exception {
given(HTR_4069);
// when
subject.update();
// then
ArgumentCaptor<ZoneControlState> stateArg = ArgumentCaptor.forClass(ZoneControlState.class);
verify(zoneControlStateListener).zoneStateChanged(stateArg.capture());
ZoneControlState state = stateArg.getValue();
assertNotNull(state);
assertEquals(false, state.power);
assertEquals(false, state.mute);
assertEquals(-34.5, state.volumeDB, 0);
assertEquals("TUNER", state.inputID);
assertEquals("5ch Stereo", state.surroundProgram);
assertEquals(1, state.dialogueLevel);
}
}

View File

@@ -0,0 +1,262 @@
/**
* Copyright (c) 2010-2020 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.yamahareceiver.internal.protocol.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.openhab.binding.yamahareceiver.internal.TestModels.*;
import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Zone.Main_Zone;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.openhab.binding.yamahareceiver.internal.state.ZoneControlState;
/**
* Unit test for {@link ZoneControlXML}.
*
* @author Tomasz Maruszak - Initial contribution
*/
public class ZoneControlXMLTest extends AbstractZoneControlXMLTest {
private ZoneControlXML subject;
private void given(String model) throws Exception {
ctx.prepareForModel(model);
DeviceInformationXML deviceInformation = new DeviceInformationXML(con, deviceInformationState);
deviceInformation.update();
subject = new ZoneControlXML(con, Main_Zone, zoneConfig, zoneControlStateListener, deviceInformationState,
() -> inputConverter);
}
@Test
public void given_RX_S601D_when_power_then_sendsProperCommand() throws Exception {
when_power_then_sendsProperCommand(RX_S601D);
}
@Test
public void given_RX_V3900_when_power_then_sendsProperCommand() throws Exception {
when_power_then_sendsProperCommand(RX_V3900);
}
private void when_power_then_sendsProperCommand(String model) throws Exception {
given(model);
// when
subject.setPower(true);
subject.setPower(false);
// then
verify(con).send(eq("<Main_Zone><Power_Control><Power>On</Power></Power_Control></Main_Zone>"));
verify(con).send(eq("<Main_Zone><Power_Control><Power>Standby</Power></Power_Control></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_mute_then_sendsProperCommand() throws Exception {
given(RX_S601D);
// when
subject.setMute(true);
subject.setMute(false);
// then
verify(con).send(eq("<Main_Zone><Volume><Mute>On</Mute></Volume></Main_Zone>"));
verify(con).send(eq("<Main_Zone><Volume><Mute>Off</Mute></Volume></Main_Zone>"));
}
@Test
public void given_RX_V3900_when_mute_then_sendsProperCommand() throws Exception {
given(RX_V3900);
// when
subject.setMute(true);
subject.setMute(false);
// then
verify(con).send(eq("<Main_Zone><Vol><Mute>On</Mute></Vol></Main_Zone>"));
verify(con).send(eq("<Main_Zone><Vol><Mute>Off</Mute></Vol></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_volume_then_sendsProperCommand() throws Exception {
given(RX_S601D);
// when
subject.setVolumeDB(-2);
// then
verify(con).send(
eq("<Main_Zone><Volume><Lvl><Val>-20</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone>"));
}
@Test
public void given_RX_V3900_when_volume_then_sendsProperCommand() throws Exception {
given(RX_V3900);
// when
subject.setVolumeDB(-2);
// then
verify(con).send(eq("<Main_Zone><Vol><Lvl><Val>-20</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Vol></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_input_then_sendsProperCommand() throws Exception {
when_input_then_sendsProperCommand(RX_S601D);
}
@Test
public void given_RX_V3900_when_input_then_sendsProperCommand() throws Exception {
when_input_then_sendsProperCommand(RX_V3900);
}
private void when_input_then_sendsProperCommand(String model) throws Exception {
given(model);
// when
subject.setInput("HDMI1");
// then
verify(con).send(eq("<Main_Zone><Input><Input_Sel>HDMI1</Input_Sel></Input></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_surroundProgram_then_sendsProperCommand() throws Exception {
given(RX_S601D);
// when
subject.setSurroundProgram("Adventure");
// then
verify(con).send(eq(
"<Main_Zone><Surround><Program_Sel><Current><Sound_Program>Adventure</Sound_Program></Current></Program_Sel></Surround></Main_Zone>"));
}
@Test
public void given_RX_V3900_when_surroundProgram_then_sendsProperCommand() throws Exception {
given(RX_V3900);
// when
subject.setSurroundProgram("Adventure");
// then
verify(con).send(eq(
"<Main_Zone><Surr><Pgm_Sel><Straight>Off</Straight><Pgm>Adventure</Pgm></Pgm_Sel></Surr></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_surroundProgramStraight_then_sendsProperCommand() throws Exception {
given(RX_S601D);
// when
subject.setSurroundProgram("Straight");
// then
verify(con).send(eq(
"<Main_Zone><Surround><Program_Sel><Current><Straight>On</Straight></Current></Program_Sel></Surround></Main_Zone>"));
}
@Test
public void given_RX_V3900_when_surroundProgramStraight_then_sendsProperCommand() throws Exception {
given(RX_V3900);
// when
subject.setSurroundProgram("Straight");
// then
verify(con).send(eq("<Main_Zone><Surr><Pgm_Sel><Straight>On</Straight></Pgm_Sel></Surr></Main_Zone>"));
}
@Test
public void given_HTR_4069_when_dialogueLevel_then_sendsProperCommand() throws Exception {
given(HTR_4069);
// when
subject.setDialogueLevel(10);
// then
verify(con).send(eq(
"<Main_Zone><Sound_Video><Dialogue_Adjust><Dialogue_Lvl>10</Dialogue_Lvl></Dialogue_Adjust></Sound_Video></Main_Zone>"));
}
@Test
public void given_RX_S601D_when_update_then_readsStateProperly() throws Exception {
given(RX_S601D);
// when
subject.update();
// then
ArgumentCaptor<ZoneControlState> stateArg = ArgumentCaptor.forClass(ZoneControlState.class);
verify(zoneControlStateListener).zoneStateChanged(stateArg.capture());
ZoneControlState state = stateArg.getValue();
assertNotNull(state);
assertEquals(false, state.power);
assertEquals(false, state.mute);
assertEquals(-43, state.volumeDB, 0);
assertEquals("Spotify", state.inputID);
assertEquals("5ch Stereo", state.surroundProgram);
// this model does not support dialogue level
assertEquals(0, state.dialogueLevel);
}
@Test
public void given_RX_V3900_when_update_then_readsStateProperly() throws Exception {
given(RX_V3900);
// when
subject.update();
// then
ArgumentCaptor<ZoneControlState> stateArg = ArgumentCaptor.forClass(ZoneControlState.class);
verify(zoneControlStateListener).zoneStateChanged(stateArg.capture());
ZoneControlState state = stateArg.getValue();
assertNotNull(state);
assertEquals(true, state.power);
assertEquals(false, state.mute);
assertEquals(-46, state.volumeDB, 0);
assertEquals("TV", state.inputID);
assertEquals("2ch Stereo", state.surroundProgram);
// this model does not support dialogue level
assertEquals(0, state.dialogueLevel);
}
@Test
public void given_HTR_4069_when_update_then_readsStateProperly() throws Exception {
given(HTR_4069);
// when
subject.update();
// then
ArgumentCaptor<ZoneControlState> stateArg = ArgumentCaptor.forClass(ZoneControlState.class);
verify(zoneControlStateListener).zoneStateChanged(stateArg.capture());
ZoneControlState state = stateArg.getValue();
assertNotNull(state);
assertEquals(false, state.power);
assertEquals(false, state.mute);
assertEquals(-46, state.volumeDB, 0);
assertEquals("TUNER", state.inputID);
assertEquals("5ch Stereo", state.surroundProgram);
assertEquals(1, state.dialogueLevel);
}
}

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Basic_Status>
<Power_Control>
<Power>Standby</Power>
<Zone_B_Power_Info>Standby</Zone_B_Power_Info>
<Sleep>Off</Sleep>
</Power_Control>
<Volume>
<Lvl>
<Val>-460</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Lvl>
<Mute>Off</Mute>
<Subwoofer_Trim>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Subwoofer_Trim>
<Scale>dB</Scale>
<Zone_B>
<Feature_Availability>Ready</Feature_Availability>
<Interlock>Off</Interlock>
<Lvl>
<Val>-345</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Lvl>
<Mute>Off</Mute>
</Zone_B>
</Volume>
<Input>
<Input_Sel>TUNER</Input_Sel>
<Input_Sel_Item_Info>
<Param>TUNER</Param>
<RW>RW</RW>
<Title>TUNER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon008.png</On>
<Off></Off>
</Icon>
<Src_Name>Tuner</Src_Name>
<Src_Number>1</Src_Number>
</Input_Sel_Item_Info>
</Input>
<Surround>
<Program_Sel>
<Current>
<Straight>Off</Straight>
<Enhancer>On</Enhancer>
<Sound_Program>5ch Stereo</Sound_Program>
</Current>
</Program_Sel>
<_3D_Cinema_DSP>Auto</_3D_Cinema_DSP>
</Surround>
<Sound_Video>
<Tone>
<Bass>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Bass>
<Treble>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Treble>
</Tone>
<Direct>
<Mode>Off</Mode>
</Direct>
<HDMI>
<Standby_Through_Info>Off</Standby_Through_Info>
<Output>
<OUT_1>On</OUT_1>
</Output>
</HDMI>
<Extra_Bass>Auto</Extra_Bass>
<Adaptive_DRC>Off</Adaptive_DRC>
<Dialogue_Adjust>
<Dialogue_Lvl>1</Dialogue_Lvl>
</Dialogue_Adjust>
</Sound_Video>
<Speaker_Preout>
<Speaker_AB>
<Speaker_A>On</Speaker_A>
<Speaker_B>Off</Speaker_B>
</Speaker_AB>
</Speaker_Preout>
</Basic_Status>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,240 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Input>
<Input_Sel_Item>
<Item_1>
<Param>Spotify</Param>
<RW>RW</RW>
<Title>Spotify</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon102.png</On>
<Off></Off>
</Icon>
<Src_Name>Spotify</Src_Name>
<Src_Number>1</Src_Number>
</Item_1>
<Item_2>
<Param>JUKE</Param>
<RW>RW</RW>
<Title>JUKE</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon103.png</On>
<Off></Off>
</Icon>
<Src_Name>JUKE</Src_Name>
<Src_Number>1</Src_Number>
</Item_2>
<Item_3>
<Param>AirPlay</Param>
<RW>RW</RW>
<Title>AirPlay</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon067.png</On>
<Off></Off>
</Icon>
<Src_Name>AirPlay</Src_Name>
<Src_Number>1</Src_Number>
</Item_3>
<Item_4>
<Param>Qobuz</Param>
<RW>RW</RW>
<Title>Qobuz</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon108.png</On>
<Off></Off>
</Icon>
<Src_Name>Qobuz</Src_Name>
<Src_Number>1</Src_Number>
</Item_4>
<Item_5>
<Param>MusicCast Link</Param>
<RW>RW</RW>
<Title>MusicCast Link</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon107.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_5>
<Item_6>
<Param>SERVER</Param>
<RW>RW</RW>
<Title>SERVER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon006.png</On>
<Off></Off>
</Icon>
<Src_Name>SERVER</Src_Name>
<Src_Number>1</Src_Number>
</Item_6>
<Item_7>
<Param>NET RADIO</Param>
<RW>RW</RW>
<Title>NET RADIO</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon005.png</On>
<Off></Off>
</Icon>
<Src_Name>NET_RADIO</Src_Name>
<Src_Number>1</Src_Number>
</Item_7>
<Item_8>
<Param>Bluetooth</Param>
<RW>RW</RW>
<Title>Bluetooth</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon105.png</On>
<Off></Off>
</Icon>
<Src_Name>Bluetooth</Src_Name>
<Src_Number>1</Src_Number>
</Item_8>
<Item_9>
<Param>USB</Param>
<RW>RW</RW>
<Title>USB</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon009.png</On>
<Off></Off>
</Icon>
<Src_Name>USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_9>
<Item_10>
<Param>TUNER</Param>
<RW>RW</RW>
<Title>TUNER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon008.png</On>
<Off></Off>
</Icon>
<Src_Name>Tuner</Src_Name>
<Src_Number>1</Src_Number>
</Item_10>
<Item_11>
<Param>HDMI1</Param>
<RW>RW</RW>
<Title>HDMI1</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_11>
<Item_12>
<Param>HDMI2</Param>
<RW>RW</RW>
<Title>HDMI2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_12>
<Item_13>
<Param>HDMI3</Param>
<RW>RW</RW>
<Title>HDMI3</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_13>
<Item_14>
<Param>HDMI4</Param>
<RW>RW</RW>
<Title>HDMI4</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_14>
<Item_15>
<Param>AV1</Param>
<RW>RW</RW>
<Title>AV1</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_15>
<Item_16>
<Param>AV2</Param>
<RW>RW</RW>
<Title>AV2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_16>
<Item_17>
<Param>AV3</Param>
<RW>RW</RW>
<Title>AV3</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_17>
<Item_18>
<Param>AV4</Param>
<RW>RW</RW>
<Title>AV4</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_18>
<Item_19>
<Param>AUDIO1</Param>
<RW>RW</RW>
<Title>AUDIO1</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon002.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_19>
<Item_20>
<Param>AUDIO2</Param>
<RW>RW</RW>
<Title>AUDIO2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon002.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_20>
<Item_21>
<Param>AUX</Param>
<RW>RW</RW>
<Title>AUX</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon104.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_21>
</Input_Sel_Item>
</Input>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Config>
<Model_Name>HTR-4069</Model_Name>
<System_ID>054E5023</System_ID>
<Version>1.23/2.40</Version>
<Feature_Existence>
<Main_Zone>1</Main_Zone>
<Zone_2>0</Zone_2>
<Zone_3>0</Zone_3>
<Zone_4>0</Zone_4>
<Tuner>1</Tuner>
<DAB>0</DAB>
<HD_Radio>0</HD_Radio>
<Rhapsody>0</Rhapsody>
<Napster>0</Napster>
<SiriusXM>0</SiriusXM>
<Spotify>1</Spotify>
<Pandora>0</Pandora>
<JUKE>1</JUKE>
<Qobuz>1</Qobuz>
<radiko_jp>0</radiko_jp>
<TIDAL>0</TIDAL>
<Deezer>0</Deezer>
<MusicCast_Link>0</MusicCast_Link>
<SERVER>1</SERVER>
<NET_RADIO>1</NET_RADIO>
<Bluetooth>1</Bluetooth>
<USB>1</USB>
<AirPlay>1</AirPlay>
</Feature_Existence>
<Name>
<Input>
<HDMI_1>HDMI1</HDMI_1>
<HDMI_2>HDMI2</HDMI_2>
<HDMI_3>HDMI3</HDMI_3>
<HDMI_4>HDMI4</HDMI_4>
<AV_1>AV1</AV_1>
<AV_2>AV2</AV_2>
<AV_3>AV3</AV_3>
<AV_4>AV4</AV_4>
<AUX>AUX</AUX>
<AUDIO_1>AUDIO1</AUDIO_1>
<AUDIO_2>AUDIO2</AUDIO_2>
<Bluetooth>Bluetooth</Bluetooth>
<USB>USB</USB>
</Input>
</Name>
</Config>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,20 @@
<YAMAHA_AV rsp="GET" RC="0">
<Bluetooth>
<Play_Info>
<Feature_Availability>Ready</Feature_Availability>
<Connection_Info>Connected</Connection_Info>
<Device_Name>OnePlus 3T</Device_Name>
<Playback_Info>Play</Playback_Info>
<Meta_Info>
<Artist>M.I.K.E.</Artist>
<Album>A State Of Trance Classics, Vol. 12 (The Full Unmixed Versions)</Album>
<Song>Voices From The Inside</Song>
</Meta_Info>
<Input_Logo>
<URL_S>/YamahaRemoteControl/Logos/logo007.png</URL_S>
<URL_M></URL_M>
<URL_L></URL_L>
</Input_Logo>
</Play_Info>
</Bluetooth>
</YAMAHA_AV>

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Basic_Status>
<Power_Control>
<Power>Standby</Power>
<Sleep>Off</Sleep>
</Power_Control>
<Volume>
<Lvl>
<Val>-430</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Lvl>
<Mute>Off</Mute>
<Subwoofer_Trim>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Subwoofer_Trim>
<Scale>dB</Scale>
</Volume>
<Input>
<Input_Sel>Spotify</Input_Sel>
<Input_Sel_Item_Info>
<Param>Spotify</Param>
<RW>RW</RW>
<Title>Spotify</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon102.png</On>
<Off></Off>
</Icon>
<Src_Name>Spotify</Src_Name>
<Src_Number>1</Src_Number>
</Input_Sel_Item_Info>
</Input>
<Surround>
<Program_Sel>
<Current>
<Straight>Off</Straight>
<Enhancer>On</Enhancer>
<Sound_Program>5ch Stereo</Sound_Program>
</Current>
</Program_Sel>
<_3D_Cinema_DSP>Auto</_3D_Cinema_DSP>
</Surround>
<Party_Info>Off</Party_Info>
<Sound_Video>
<Tone>
<Bass>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Bass>
<Treble>
<Val>0</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Treble>
</Tone>
<Direct>
<Mode>Off</Mode>
</Direct>
<HDMI>
<Standby_Through_Info>On</Standby_Through_Info>
<Output>
<OUT_1>On</OUT_1>
</Output>
</HDMI>
<Extra_Bass>Off</Extra_Bass>
<Adaptive_DRC>Auto</Adaptive_DRC>
</Sound_Video>
</Basic_Status>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,261 @@
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Input>
<Input_Sel_Item>
<Item_1>
<Param>Spotify</Param>
<RW>RW</RW>
<Title>Spotify</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon102.png</On>
<Off></Off>
</Icon>
<Src_Name>Spotify</Src_Name>
<Src_Number>1</Src_Number>
</Item_1>
<Item_2>
<Param>JUKE</Param>
<RW>RW</RW>
<Title>JUKE</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon103.png</On>
<Off></Off>
</Icon>
<Src_Name>JUKE</Src_Name>
<Src_Number>1</Src_Number>
</Item_2>
<Item_3>
<Param>AirPlay</Param>
<RW>RW</RW>
<Title>AirPlay</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon067.png</On>
<Off></Off>
</Icon>
<Src_Name>AirPlay</Src_Name>
<Src_Number>1</Src_Number>
</Item_3>
<Item_4>
<Param>MusicCast Link</Param>
<RW>RW</RW>
<Title>MusicCast Link</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon107.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_4>
<Item_5>
<Param>SERVER</Param>
<RW>RW</RW>
<Title>SERVER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon006.png</On>
<Off></Off>
</Icon>
<Src_Name>SERVER</Src_Name>
<Src_Number>1</Src_Number>
</Item_5>
<Item_6>
<Param>NET RADIO</Param>
<RW>RW</RW>
<Title>NET RADIO</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon005.png</On>
<Off></Off>
</Icon>
<Src_Name>NET_RADIO</Src_Name>
<Src_Number>1</Src_Number>
</Item_6>
<Item_7>
<Param>Bluetooth</Param>
<RW>RW</RW>
<Title>Bluetooth</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon105.png</On>
<Off></Off>
</Icon>
<Src_Name>Bluetooth</Src_Name>
<Src_Number>1</Src_Number>
</Item_7>
<Item_8>
<Param>USB</Param>
<RW>RW</RW>
<Title>USB</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon009.png</On>
<Off></Off>
</Icon>
<Src_Name>USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_8>
<Item_9>
<Param>iPod (USB)</Param>
<RW>R</RW>
<Title>USB</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon011.png</On>
<Off></Off>
</Icon>
<Src_Name>iPod_USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_9>
<Item_10>
<Param>TUNER</Param>
<RW>RW</RW>
<Title>TUNER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon008.png</On>
<Off></Off>
</Icon>
<Src_Name>DAB</Src_Name>
<Src_Number>1</Src_Number>
</Item_10>
<Item_11>
<Param>HDMI1</Param>
<RW>RW</RW>
<Title>raspberry</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_11>
<Item_12>
<Param>HDMI2</Param>
<RW>RW</RW>
<Title>Kodi</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_12>
<Item_13>
<Param>HDMI3</Param>
<RW>RW</RW>
<Title>HDMI3</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_13>
<Item_14>
<Param>HDMI4</Param>
<RW>RW</RW>
<Title>HDMI4</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_14>
<Item_15>
<Param>HDMI5</Param>
<RW>RW</RW>
<Title>HDMI5</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_15>
<Item_16>
<Param>HDMI6</Param>
<RW>RW</RW>
<Title>Kodi:2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon004.png</On>
<Off></Off>
</Icon>
<Src_Name>Osdname:Kodi</Src_Name>
<Src_Number>1</Src_Number>
</Item_16>
<Item_17>
<Param>AV1</Param>
<RW>RW</RW>
<Title>AV1</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_17>
<Item_18>
<Param>AV2</Param>
<RW>RW</RW>
<Title>AV2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_18>
<Item_19>
<Param>AV3</Param>
<RW>RW</RW>
<Title>AV3</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon003.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_19>
<Item_20>
<Param>AUDIO1</Param>
<RW>RW</RW>
<Title>AUDIO1</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon002.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_20>
<Item_21>
<Param>AUDIO2</Param>
<RW>RW</RW>
<Title>AUDIO2</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon002.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_21>
<Item_22>
<Param>AUDIO3</Param>
<RW>RW</RW>
<Title>AUDIO3</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon002.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_22>
<Item_23>
<Param>AUX</Param>
<RW>RW</RW>
<Title>AUX</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon104.png</On>
<Off></Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_23>
</Input_Sel_Item>
</Input>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,20 @@
<YAMAHA_AV rsp="GET" RC="0">
<NET_RADIO>
<Play_Control>
<Preset>
<Preset_Sel_Item>
<Item_1>
<Param>1</Param>
<RW>W</RW>
<Title>1 : NET RADIO Chilli ZET PL</Title>
</Item_1>
<Item_2>
<Param>2</Param>
<RW>W</RW>
<Title>2 : NET RADIO Polskie Radio 24</Title>
</Item_2>
</Preset_Sel_Item>
</Preset>
</Play_Control>
</NET_RADIO>
</YAMAHA_AV>

View File

@@ -0,0 +1,21 @@
<YAMAHA_AV rsp="GET" RC="0">
<NET_RADIO>
<Play_Info>
<Feature_Availability>Ready</Feature_Availability>
<Playback_Info>Play</Playback_Info>
<Time>
<Elapsed>0:14</Elapsed>
</Time>
<Meta_Info>
<Station>Chilli ZET PL</Station>
<Album></Album>
<Song>LESZEK MOZDZER - ZDROWY KOLATAJ</Song>
</Meta_Info>
<Album_ART>
<URL>/YamahaRemoteControl/AlbumART/AlbumART4626.jpg</URL>
<ID>46266</ID>
<Format>JPEG</Format>
</Album_ART>
</Play_Info>
</NET_RADIO>
</YAMAHA_AV>

View File

@@ -0,0 +1,23 @@
<YAMAHA_AV rsp="GET" RC="0">
<Spotify>
<Play_Info>
<Feature_Availability>Ready</Feature_Availability>
<Playback_Info>Play</Playback_Info>
<Meta_Info>
<Artist>Above &amp; Beyond</Artist>
<Album>Acoustic - Live At The Hollywood Bowl</Album>
<Track>No One On Earth - Live At The Hollywood Bowl</Track>
</Meta_Info>
<Album_ART>
<URL>/YamahaRemoteControl/AlbumART/AlbumART6585.jpg</URL>
<ID>65852</ID>
<Format>JPEG</Format>
</Album_ART>
<Input_Logo>
<URL_S>/YamahaRemoteControl/Logos/logo005.png</URL_S>
<URL_M></URL_M>
<URL_L></URL_L>
</Input_Logo>
</Play_Info>
</Spotify>
</YAMAHA_AV>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Config>
<Model_Name>RX-S601D</Model_Name>
<System_ID>0EE27BE3</System_ID>
<Version>1.81/3.70</Version>
<Feature_Existence>
<Main_Zone>1</Main_Zone>
<Zone_2>1</Zone_2>
<Zone_3>0</Zone_3>
<Zone_4>0</Zone_4>
<Tuner>0</Tuner>
<DAB>1</DAB>
<HD_Radio>0</HD_Radio>
<Rhapsody>0</Rhapsody>
<Napster>0</Napster>
<SiriusXM>0</SiriusXM>
<Spotify>1</Spotify>
<Pandora>0</Pandora>
<JUKE>1</JUKE>
<MusicCast_Link>1</MusicCast_Link>
<SERVER>1</SERVER>
<NET_RADIO>1</NET_RADIO>
<Bluetooth>1</Bluetooth>
<USB>1</USB>
<iPod_USB>1</iPod_USB>
<AirPlay>1</AirPlay>
</Feature_Existence>
<Name>
<Input>
<HDMI_1>Kodi</HDMI_1>
<HDMI_2>9xxxx</HDMI_2>
<HDMI_3>HDMI3</HDMI_3>
<HDMI_4>HDMI4</HDMI_4>
<HDMI_5>HDMI5</HDMI_5>
<HDMI_6>HDMI6</HDMI_6>
<AV_1>AV1</AV_1>
<AV_2>AV2</AV_2>
<AV_3>AV3</AV_3>
<AUX>AUX</AUX>
<AUDIO_1>AUDIO1</AUDIO_1>
<AUDIO_2>AUDIO2</AUDIO_2>
<AUDIO_3>AUDIO3</AUDIO_3>
<Bluetooth>Bluetooth</Bluetooth>
<USB>USB</USB>
</Input>
</Name>
</Config>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Party_Mode>
<Mode>On</Mode>
</Party_Mode>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Power_Control>
<Power>On</Power>
</Power_Control>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,7 @@
<YAMAHA_AV rsp="GET" RC="0">
<Bluetooth>
<Play_Info>
<Status>Not Connected</Status>
</Play_Info>
</Bluetooth>
</YAMAHA_AV>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Basic_Status>
<Power_Control>
<Power>On</Power>
<Sleep>Off</Sleep>
</Power_Control>
<Vol>
<Lvl>
<Val>-460</Val>
<Exp>1</Exp>
<Unit>dB</Unit>
</Lvl>
<Mute>Off</Mute>
</Vol>
<Input>
<Input_Sel>TV</Input_Sel>
<Input_Sel_Title>TV</Input_Sel_Title>
</Input>
<Surr>
<Pgm_Sel>
<Straight>Off</Straight>
<Pgm>2ch Stereo</Pgm>
</Pgm_Sel>
</Surr>
</Basic_Status>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,206 @@
<YAMAHA_AV rsp="GET" RC="0">
<Main_Zone>
<Input>
<Input_Sel_Item>
<Item_1>
<Param>NET RADIO</Param>
<RW>RW</RW>
<Title>NET RADIO</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon39.png</On>
<Off>/YamahaRemoteControl/Icons/icon38.png</Off>
</Icon>
<Src_Name>NET_USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_1>
<Item_2>
<Param>PC/MCX</Param>
<RW>RW</RW>
<Title>PC/MCX</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon37.png</On>
<Off>/YamahaRemoteControl/Icons/icon36.png</Off>
</Icon>
<Src_Name>NET_USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_2>
<Item_3>
<Param>DOCK</Param>
<RW>W</RW>
<Title>DOCK</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon25.png</On>
<Off>/YamahaRemoteControl/Icons/icon24.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_3>
<Item_4>
<Param>iPod</Param>
<RW>R</RW>
<Title>iPod</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon33.png</On>
<Off>/YamahaRemoteControl/Icons/icon32.png</Off>
</Icon>
<Src_Name>iPod</Src_Name>
<Src_Number>1</Src_Number>
</Item_4>
<Item_5>
<Param>Bluetooth</Param>
<RW>R</RW>
<Title>Bluetooth</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon35.png</On>
<Off>/YamahaRemoteControl/Icons/icon34.png</Off>
</Icon>
<Src_Name>Bluetooth</Src_Name>
<Src_Number>1</Src_Number>
</Item_5>
<Item_6>
<Param>USB</Param>
<RW>RW</RW>
<Title>USB</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon41.png</On>
<Off>/YamahaRemoteControl/Icons/icon40.png</Off>
</Icon>
<Src_Name>NET_USB</Src_Name>
<Src_Number>1</Src_Number>
</Item_6>
<Item_7>
<Param>TUNER</Param>
<RW>RW</RW>
<Title>TUNER</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon01.png</On>
<Off>/YamahaRemoteControl/Icons/icon00.png</Off>
</Icon>
<Src_Name>Tuner</Src_Name>
<Src_Number>1</Src_Number>
</Item_7>
<Item_8>
<Param>CBL/SAT</Param>
<RW>RW</RW>
<Title>CBL/SAT</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon17.png</On>
<Off>/YamahaRemoteControl/Icons/icon16.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_8>
<Item_9>
<Param>BD/HD DVD</Param>
<RW>RW</RW>
<Title>BD/HD DVD</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon13.png</On>
<Off>/YamahaRemoteControl/Icons/icon12.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_9>
<Item_10>
<Param>V-AUX</Param>
<RW>RW</RW>
<Title>VIDEO AUX</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon23.png</On>
<Off>/YamahaRemoteControl/Icons/icon22.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_10>
<Item_11>
<Param>DVD</Param>
<RW>RW</RW>
<Title>DVD</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon15.png</On>
<Off>/YamahaRemoteControl/Icons/icon14.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_11>
<Item_12>
<Param>CD</Param>
<RW>RW</RW>
<Title>CD</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon07.png</On>
<Off>/YamahaRemoteControl/Icons/icon06.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_12>
<Item_13>
<Param>DVR</Param>
<RW>RW</RW>
<Title>DVR</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon19.png</On>
<Off>/YamahaRemoteControl/Icons/icon18.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_13>
<Item_14>
<Param>TV</Param>
<RW>RW</RW>
<Title>TV</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon09.png</On>
<Off>/YamahaRemoteControl/Icons/icon08.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_14>
<Item_15>
<Param>VCR</Param>
<RW>RW</RW>
<Title>VCR</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon21.png</On>
<Off>/YamahaRemoteControl/Icons/icon20.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_15>
<Item_16>
<Param>PHONO</Param>
<RW>RW</RW>
<Title>PHONO</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon05.png</On>
<Off>/YamahaRemoteControl/Icons/icon04.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_16>
<Item_17>
<Param>MD/CD-R</Param>
<RW>RW</RW>
<Title>MD/CD-R</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon11.png</On>
<Off>/YamahaRemoteControl/Icons/icon10.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_17>
<Item_18>
<Param>MULTI CH</Param>
<RW>RW</RW>
<Title>MULTI CH</Title>
<Icon>
<On>/YamahaRemoteControl/Icons/icon03.png</On>
<Off>/YamahaRemoteControl/Icons/icon02.png</Off>
</Icon>
<Src_Name></Src_Name>
<Src_Number>1</Src_Number>
</Item_18>
</Input_Sel_Item>
</Input>
</Main_Zone>
</YAMAHA_AV>

View File

@@ -0,0 +1,40 @@
<YAMAHA_AV rsp="GET" RC="0">
<NET_USB>
<Play_Control>
<Preset>
<Preset_Sel_Item>
<Item_1>
<Param>B1</Param>
<RW>W</RW>
<Title>1 :NET RADIO</Title>
</Item_1>
<Item_2>
<Param>B2</Param>
<RW>W</RW>
<Title>2 :NET RADIO</Title>
</Item_2>
<Item_3>
<Param>B3</Param>
<RW>W</RW>
<Title>3 :NET RADIO</Title>
</Item_3>
<Item_4>
<Param>B4</Param>
<RW>W</RW>
<Title>4 :NET RADIO</Title>
</Item_4>
<Item_5>
<Param>B5</Param>
<RW>W</RW>
<Title>5 :NET RADIO</Title>
</Item_5>
<Item_6>
<Param>B6</Param>
<RW>W</RW>
<Title>6 :NET RADIO</Title>
</Item_6>
</Preset_Sel_Item>
</Preset>
</Play_Control>
</NET_USB>
</YAMAHA_AV>

View File

@@ -0,0 +1,17 @@
<YAMAHA_AV rsp="GET" RC="0">
<NET_USB>
<Play_Info>
<SubInput>NET RADIO</SubInput>
<Status>Play</Status>
<Play_Mode>
<Repeat>All</Repeat>
<Shuffle>Off</Shuffle>
</Play_Mode>
<Title>
<Artist>Some Artist</Artist>
<Album>Some Album</Album>
<Song>SuomiPOP 98.1</Song>
</Title>
</Play_Info>
</NET_USB>
</YAMAHA_AV>

View File

@@ -0,0 +1,12 @@
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Config>
<Model_Name>RX-V3900</Model_Name>
<System_ID>0CE4E483</System_ID>
<Version>
<Main> Y.0125.0205</Main>
<Sub>V119</Sub>
</Version>
</Config>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<YAMAHA_AV rsp="GET" RC="0">
<System>
<Power_Control>
<Power>On</Power>
</Power_Control>
</System>
</YAMAHA_AV>

View File

@@ -0,0 +1,9 @@
<YAMAHA_AV rsp="GET" RC="0">
<Tuner>
<Play_Control>
<Preset>
<Preset_Sel>A1</Preset_Sel>
</Preset>
</Play_Control>
</Tuner>
</YAMAHA_AV>

View File

@@ -0,0 +1,95 @@
<YAMAHA_AV rsp="GET" RC="0">
<Tuner>
<Play_Control>
<Preset>
<Preset_Sel_Item>
<Item_1>
<Param>Not Used</Param>
<RW>R</RW>
<Title></Title>
</Item_1>
<Item_2>
<Param>A1</Param>
<RW>RW</RW>
<Title>A1</Title>
</Item_2>
<Item_3>
<Param>A2</Param>
<RW>RW</RW>
<Title>A2</Title>
</Item_3>
<Item_4>
<Param>A3</Param>
<RW>RW</RW>
<Title>A3</Title>
</Item_4>
<Item_5>
<Param>A4</Param>
<RW>RW</RW>
<Title>A4</Title>
</Item_5>
<Item_6>
<Param>A5</Param>
<RW>RW</RW>
<Title>A5</Title>
</Item_6>
<Item_7>
<Param>A6</Param>
<RW>RW</RW>
<Title>A6</Title>
</Item_7>
<Item_8>
<Param>A7</Param>
<RW>RW</RW>
<Title>A7</Title>
</Item_8>
<Item_9>
<Param>A8</Param>
<RW>RW</RW>
<Title>A8</Title>
</Item_9>
<Item_10>
<Param>B1</Param>
<RW>RW</RW>
<Title>B1</Title>
</Item_10>
<Item_11>
<Param>B2</Param>
<RW>RW</RW>
<Title>B2</Title>
</Item_11>
<Item_12>
<Param>B3</Param>
<RW>RW</RW>
<Title>B3</Title>
</Item_12>
<Item_13>
<Param>B4</Param>
<RW>RW</RW>
<Title>B4</Title>
</Item_13>
<Item_14>
<Param>B5</Param>
<RW>RW</RW>
<Title>B5</Title>
</Item_14>
<Item_15>
<Param>B6</Param>
<RW>RW</RW>
<Title>B6</Title>
</Item_15>
<Item_16>
<Param>B7</Param>
<RW>RW</RW>
<Title>B7</Title>
</Item_16>
<Item_17>
<Param>B8</Param>
<RW>RW</RW>
<Title>B8</Title>
</Item_17>
</Preset_Sel_Item>
</Preset>
</Play_Control>
</Tuner>
</YAMAHA_AV>

View File

@@ -0,0 +1,30 @@
<YAMAHA_AV rsp="GET" RC="0">
<Tuner>
<Play_Info>
<Search_Mode>Preset</Search_Mode>
<Preset>A1</Preset>
<Preset_Sel_Title>FM 98.10MHz</Preset_Sel_Title>
<Tuning>
<Band>FM</Band>
<Freq>
<Val>9810</Val>
<Exp>2</Exp>
<Unit>MHz</Unit>
</Freq>
</Tuning>
<Stereo_Mono>Auto</Stereo_Mono>
<Receive_Status>
<Tuned>Assert</Tuned>
<Stereo>Assert</Stereo>
</Receive_Status>
<RDS>
<Program_Type>POP_M</Program_Type>
<Program_Service>SUOMIPOP</Program_Service>
<Radio_Text_A></Radio_Text_A>
<Radio_Text_B></Radio_Text_B>
<Clock_Time>0:0</Clock_Time>
<EON>Assert</EON>
</RDS>
</Play_Info>
</Tuner>
</YAMAHA_AV>

View File

@@ -0,0 +1,17 @@
<YAMAHA_AV rsp="GET" RC="0">
<iPod>
<Play_Info>
<Status>Not Connected</Status>
<Play_Mode>
<Control>Normal</Control>
<Repeat>Off</Repeat>
<Shuffle>Off</Shuffle>
</Play_Mode>
<Title>
<Artist></Artist>
<Album></Album>
<Song></Song>
</Title>
</Play_Info>
</iPod>
</YAMAHA_AV>