Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oppo] Update Play/Pause status to Player channel widget #15662

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bundles/org.openhab.binding.oppo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ String oppo_remote_button "Remote Button [%s]" { channel="oppo:player:myoppo:rem
secondsformat.js:

```javascript
(function(totalSeconds) {
(function(timestamp) {
var totalSeconds = Date.parse(timestamp) / 1000

if (isNaN(totalSeconds)) {
return '-';
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ public void handleCommand(ChannelUID channelUID, Command command) {
}
break;
default:
logger.warn("Unknown Command {} from channel {}", command, channel);
logger.debug("Unknown command {} from channel {}", command, channel);
break;
}
} catch (OppoException e) {
logger.warn("Command {} from channel {} failed: {}", command, channel, e.getMessage());
logger.debug("Command {} from channel {} failed: {}", command, channel, e.getMessage());
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Sending command failed");
closeConnection();
scheduleReconnectJob();
Expand Down Expand Up @@ -492,6 +492,8 @@ public void onNewMessageEvent(OppoMessageEvent evt) {
updateChannelState(CHANNEL_SUBTITLE_TYPE, UNDEF);
}
updateChannelState(CHANNEL_PLAY_MODE, playStatus);
updateState(CHANNEL_CONTROL,
PLAY.equals(playStatus) ? PlayPauseType.PLAY : PlayPauseType.PAUSE);

// ejecting the disc does not produce a UDT message, so clear disc type manually
if (OPEN.equals(playStatus) || NO_DISC.equals(playStatus)) {
Expand Down Expand Up @@ -716,7 +718,7 @@ private void schedulePollingJob() {
}

} catch (OppoException | InterruptedException e) {
logger.warn("Polling error: {}", e.getMessage());
logger.debug("Polling error: {}", e.getMessage());
}

// if the last event received was more than 1.25 intervals ago,
Expand Down Expand Up @@ -835,7 +837,7 @@ private void handleControlCommand(Command command) throws OppoException {
connector.sendCommand(OppoCommand.REWIND);
}
} else {
logger.warn("Unknown control command: {}", command);
logger.debug("Unknown control command: {}", command);
}
}

Expand Down