Skip to content

Commit

Permalink
[freeboxos] Get server AirPlay capabilities
Browse files Browse the repository at this point in the history
This will set the related thing properties.
No audio sink will be created for the revolution server as it only supports audio and pushing audio media is not yet supported by the API.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed Aug 14, 2024
1 parent 034c03f commit bce9b79
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public class ServerHandler extends ApiConsumerHandler implements FreeDeviceIntf

private long uptime = -1;

private boolean tryConfigureMediaSink = true;

public ServerHandler(Thing thing) {
super(thing);
eventChannelUID = new ChannelUID(getThing().getUID(), GROUP_SYS_INFO, BOX_EVENT);
Expand Down Expand Up @@ -147,6 +149,11 @@ protected void internalPoll() throws FreeboxException {
if (anyChannelLinked(GROUP_FILE_SHARING, Set.of(AFP_FILE_STATUS))) {
updateChannelOnOff(GROUP_FILE_SHARING, AFP_FILE_STATUS, getManager(AfpManager.class).getStatus());
}

if (tryConfigureMediaSink) {
configureMediaSink();
tryConfigureMediaSink = false;
}
}

private void fetchSystemConfig() throws FreeboxException {
Expand Down Expand Up @@ -235,6 +242,7 @@ protected boolean internalHandleCommand(String channelId, Command command) throw
case AIRMEDIA_STATUS:
updateChannelOnOff(GROUP_ACTIONS, AIRMEDIA_STATUS,
getManager(AirMediaManager.class).setStatus(enable));
tryConfigureMediaSink = true;
return true;
default:
break;
Expand Down

0 comments on commit bce9b79

Please sign in to comment.