Skip to content

Commit

Permalink
Merge pull request #123 from kgoderis/sonos
Browse files Browse the repository at this point in the history
Fix bugs in playLineIn()
  • Loading branch information
kaikreuzer committed Feb 7, 2015
2 parents 21c6ea6 + b490af2 commit 0795c8d
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1241,25 +1241,25 @@ public void playLineIn(Command command) {
if (command != null && command instanceof StringType) {

String remotePlayerName = command.toString();

Thing coordinatorThing = thingRegistry.get(new ThingUID(
ZONEPLAYER_THING_TYPE_UID, getCoordinator()));
ZonePlayerHandler coordinatorHandler = (ZonePlayerHandler) coordinatorThing
.getHandler();
String coordinatorUDN = getCoordinator();
ZonePlayerHandler coordinatorHandler = getHandlerByName(coordinatorUDN);
ZonePlayerHandler remoteHandler = getHandlerByName(remotePlayerName);

// stop whatever is currently playing
coordinatorHandler.stop();
if(coordinatorHandler!=null && remoteHandler!=null) {

// set the URI
coordinatorHandler.setCurrentURI("x-rincon-stream:"
+ remoteHandler.getConfig().get(UDN), "");
// stop whatever is currently playing
coordinatorHandler.stop();

// take the system off mute
coordinatorHandler.setMute(OnOffType.OFF);
// set the URI
coordinatorHandler.setCurrentURI("x-rincon-stream:"
+ remoteHandler.getConfig().get(UDN), "");

// start jammin'
coordinatorHandler.play();
// take the system off mute
coordinatorHandler.setMute(OnOffType.OFF);

// start jammin'
coordinatorHandler.play();
}
}
}

Expand Down

0 comments on commit 0795c8d

Please sign in to comment.