]> git.basschouten.com Git - openhab-addons.git/blob
858511b9c05f2c854eaa4cece3f7842dd7caeb94
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.hyperion.internal.protocol;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link ColorCommand} is a POJO for sending a color command
19  * to the Hyperion server.
20  *
21  * @author Daniel Walters - Initial contribution
22  */
23 public class ColorCommand extends HyperionCommand {
24
25     @SerializedName("origin")
26     private String origin;
27     private static final String NAME = "color";
28
29     @SerializedName("priority")
30     private int priority;
31
32     @SerializedName("color")
33     private int[] color = new int[3];
34
35     public ColorCommand(int red, int green, int blue, int priority) {
36         super(NAME);
37         setPriority(priority);
38         setColor(red, green, blue);
39     }
40
41     public void setColor(int red, int green, int blue) {
42         color[0] = red;
43         color[1] = green;
44         color[2] = blue;
45     }
46
47     public int getPriority() {
48         return priority;
49     }
50
51     public void setPriority(int priority) {
52         this.priority = priority;
53     }
54
55     public int[] getColor() {
56         return color;
57     }
58
59     public void setOrigin(String origin) {
60         this.origin = origin;
61     }
62
63     public String getOrigin() {
64         return origin;
65     }
66 }