[freeboxos] Keep enum in API response record DTO (play media) (#17282)

Partial revert of #17244

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2024-08-18 13:24:42 +02:00 committed by GitHub
parent 25ec3a33b7
commit 687337f88b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,8 @@ import org.openhab.binding.freeboxos.internal.api.FreeboxException;
import org.openhab.binding.freeboxos.internal.api.Response; import org.openhab.binding.freeboxos.internal.api.Response;
import org.openhab.binding.freeboxos.internal.api.rest.MediaReceiverManager.Receiver; import org.openhab.binding.freeboxos.internal.api.rest.MediaReceiverManager.Receiver;
import com.google.gson.annotations.SerializedName;
/** /**
* The {@link MediaReceiverManager} is the Java class used to handle api requests related to air media receivers * The {@link MediaReceiverManager} is the Java class used to handle api requests related to air media receivers
* *
@ -41,24 +43,27 @@ public class MediaReceiverManager extends ListableRest<Receiver, MediaReceiverMa
} }
public enum Action { public enum Action {
@SerializedName("start")
START, START,
@SerializedName("stop")
STOP, STOP,
UNKNOWN UNKNOWN
} }
public enum MediaType { public enum MediaType {
@SerializedName("video")
VIDEO, VIDEO,
@SerializedName("photo")
PHOTO, PHOTO,
@SerializedName("audio")
AUDIO, AUDIO,
@SerializedName("screen")
SCREEN, SCREEN,
UNKNOWN UNKNOWN
} }
private static record Request(String password, String action, String mediaType, @Nullable String media, private static record Request(String password, Action action, MediaType mediaType, @Nullable String media,
int position) { 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 { public MediaReceiverManager(FreeboxOsSession session, UriBuilder uriBuilder) throws FreeboxException {