]> git.basschouten.com Git - openhab-addons.git/blob
a2fea7108c62340656670a34875e99f19d6e3559
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.freebox.internal.api.model;
14
15 /**
16  * The {@link FreeboxAirMediaReceiverRequest} is the Java class used to map the "AirMediaReceiverRequest"
17  * structure used by the sending request to an AirMedia receiver API
18  * https://dev.freebox.fr/sdk/os/airmedia/#
19  *
20  * @author Laurent Garnier - Initial contribution
21  */
22 public class FreeboxAirMediaReceiverRequest {
23
24     private static enum MediaAction {
25         START("start"),
26         STOP("stop");
27
28         private String action;
29
30         private MediaAction(String action) {
31             this.action = action;
32         }
33
34         public String getAction() {
35             return action;
36         }
37     }
38
39     private static enum MediaType {
40         VIDEO("video"),
41         PHOTO("photo");
42
43         private String mediaType;
44
45         private MediaType(String mediaType) {
46             this.mediaType = mediaType;
47         }
48
49         public String getMediaType() {
50             return mediaType;
51         }
52     }
53
54     private String action;
55     private String mediaType;
56     private String password;
57     private Integer position;
58     private String media;
59
60     public void setStartAction() {
61         this.action = MediaAction.START.getAction();
62     }
63
64     public void setStopAction() {
65         this.action = MediaAction.STOP.getAction();
66     }
67
68     public void setVideoMediaType() {
69         this.mediaType = MediaType.VIDEO.getMediaType();
70     }
71
72     public void setPassword(String password) {
73         this.password = password;
74     }
75
76     public void setPosition(Integer position) {
77         this.position = position;
78     }
79
80     public void setMedia(String media) {
81         this.media = media;
82     }
83 }