Skip to content

Commit

Permalink
Added updates to playback channel
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodz committed Jan 20, 2019
1 parent a73f403 commit aaaaedb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ private void refresh(ChannelUID channelUID) {
case CHANNEL_INPUT:
result = StringType.valueOf(state.getInput());
break;
case CHANNEL_PLAYBACK:
result = StringType.valueOf(playInfo.getPlayback());
break;
case CHANNEL_ALBUMART_URL:
case CHANNEL_ALBUM_ART:
urlString = "http://" + host;
Expand Down Expand Up @@ -289,6 +292,8 @@ private void refresh() throws MusicCastException {
updateState(CHANNEL_MUTE, result);
result = StringType.valueOf(state.getInput());
updateState(CHANNEL_INPUT, result);
result = StringType.valueOf(playInfo.getPlayback());
updateState(CHANNEL_PLAYBACK, result);
String urlString = "http://" + host;
if (playInfo.getAlbumartUrl().isEmpty()) {
urlString += ":49154/Icons/120x120.jpg";
Expand Down Expand Up @@ -394,6 +399,7 @@ public void newReceivedResponseMessage(final String message) {
refresh(getThing().getChannel(CHANNEL_ARTIST).getUID());
refresh(getThing().getChannel(CHANNEL_ALBUM).getUID());
refresh(getThing().getChannel(CHANNEL_TRACK).getUID());
refresh(getThing().getChannel(CHANNEL_PLAYBACK).getUID());
} catch (MusicCastException e) {
logger.debug(e.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public Response setPlayback(Command command) throws MusicCastException {
clearQueryParameter();

if (command == PlayPauseType.PLAY) {
playback = YamahaMusicCastBindingConstants.PLAYBACK_PLAY_PAUSE;
playback = YamahaMusicCastBindingConstants.PLAYBACK_PLAY;
} else if (command == PlayPauseType.PAUSE) {
playback = YamahaMusicCastBindingConstants.PLAYBACK_PLAY_PAUSE;
playback = YamahaMusicCastBindingConstants.PLAYBACK_PAUSE;
} else if (command == StopMoveType.STOP) {
playback = YamahaMusicCastBindingConstants.PLAYBACK_STOP;
} else if (command == NextPreviousType.NEXT) {
Expand Down

0 comments on commit aaaaedb

Please sign in to comment.