Skip to content

Commit

Permalink
[freeboxos] Keep enum in API response record DTO (play media) (openha…
Browse files Browse the repository at this point in the history
…b#17282)

Partial revert of openhab#17244

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored and joni1993 committed Oct 15, 2024
1 parent 7d3a75f commit dd2318f
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.openhab.binding.freeboxos.internal.api.Response;
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
*
Expand All @@ -41,24 +43,27 @@ protected static class ReceiverResponse extends Response<Receiver> {
}

public enum Action {
@SerializedName("start")
START,
@SerializedName("stop")
STOP,
UNKNOWN
}

public enum MediaType {
@SerializedName("video")
VIDEO,
@SerializedName("photo")
PHOTO,
@SerializedName("audio")
AUDIO,
@SerializedName("screen")
SCREEN,
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) {
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 {
Expand Down

0 comments on commit dd2318f

Please sign in to comment.