UNKNOWN
}
- private static record Request(String password, Action action, MediaType mediaType, @Nullable String media,
+ private static record Request(String password, String action, String mediaType, @Nullable String media,
int position) {
+ Request(String password, Action action, MediaType mediaType, @Nullable String media, int position) {
+ this(password, action.name().toLowerCase(), mediaType.name().toLowerCase(), media, position);
+ }
}
public MediaReceiverManager(FreeboxOsSession session, UriBuilder uriBuilder) throws FreeboxException {
}
private void sendToReceiver(String receiver, Request payload) throws FreeboxException {
- post(payload, GenericResponse.class, receiver);
+ post(payload, receiver);
}
}
import javax.ws.rs.core.UriBuilder;
import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.freeboxos.internal.api.FreeboxException;
import org.openhab.binding.freeboxos.internal.api.PermissionException;
import org.openhab.binding.freeboxos.internal.api.Response;
}
protected void post(String... pathElements) throws FreeboxException {
- session.execute(buildUri(pathElements), POST, GenericResponse.class, null);
+ post(null, pathElements);
+ }
+
+ protected <F> void post(@Nullable F payload, String... pathElements) throws FreeboxException {
+ session.execute(buildUri(pathElements), POST, GenericResponse.class, payload);
}
protected <F, T extends Response<F>> F put(Class<T> clazz, F payload, String... pathElements)
private void startAudioSink(Receiver receiver) {
FreeboxOsHandler bridgeHandler = checkBridgeHandler();
// Only video and photo is supported by the API so use VIDEO capability for audio
- Boolean isAudioReceiver = receiver.capabilities().get(MediaType.VIDEO);
- if (reg == null && bridgeHandler != null && isAudioReceiver != null && isAudioReceiver.booleanValue()) {
+ if (reg == null && bridgeHandler != null && Boolean.TRUE.equals(receiver.capabilities().get(MediaType.VIDEO))) {
ApiConsumerConfiguration config = getConfig().as(ApiConsumerConfiguration.class);
String callbackURL = bridgeHandler.getCallbackURL();
if (!config.password.isEmpty() || !receiver.passwordProtected()) {