Update Play/Pause status to Player channel widget (#15662)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
fef9680af5
commit
b355fa7578
@ -168,7 +168,9 @@ String oppo_remote_button "Remote Button [%s]" { channel="oppo:player:myoppo:rem
|
|||||||
secondsformat.js:
|
secondsformat.js:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
(function(totalSeconds) {
|
(function(timestamp) {
|
||||||
|
var totalSeconds = Date.parse(timestamp) / 1000
|
||||||
|
|
||||||
if (isNaN(totalSeconds)) {
|
if (isNaN(totalSeconds)) {
|
||||||
return '-';
|
return '-';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -324,11 +324,11 @@ public class OppoHandler extends BaseThingHandler implements OppoMessageEventLis
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger.warn("Unknown Command {} from channel {}", command, channel);
|
logger.debug("Unknown command {} from channel {}", command, channel);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (OppoException e) {
|
} 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");
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Sending command failed");
|
||||||
closeConnection();
|
closeConnection();
|
||||||
scheduleReconnectJob();
|
scheduleReconnectJob();
|
||||||
@ -492,6 +492,8 @@ public class OppoHandler extends BaseThingHandler implements OppoMessageEventLis
|
|||||||
updateChannelState(CHANNEL_SUBTITLE_TYPE, UNDEF);
|
updateChannelState(CHANNEL_SUBTITLE_TYPE, UNDEF);
|
||||||
}
|
}
|
||||||
updateChannelState(CHANNEL_PLAY_MODE, playStatus);
|
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
|
// ejecting the disc does not produce a UDT message, so clear disc type manually
|
||||||
if (OPEN.equals(playStatus) || NO_DISC.equals(playStatus)) {
|
if (OPEN.equals(playStatus) || NO_DISC.equals(playStatus)) {
|
||||||
@ -716,7 +718,7 @@ public class OppoHandler extends BaseThingHandler implements OppoMessageEventLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (OppoException | InterruptedException e) {
|
} 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,
|
// if the last event received was more than 1.25 intervals ago,
|
||||||
@ -835,7 +837,7 @@ public class OppoHandler extends BaseThingHandler implements OppoMessageEventLis
|
|||||||
connector.sendCommand(OppoCommand.REWIND);
|
connector.sendCommand(OppoCommand.REWIND);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Unknown control command: {}", command);
|
logger.debug("Unknown control command: {}", command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user