]> git.basschouten.com Git - openhab-addons.git/blob
1946b3de2c638a72f9ab88bc39c1e3f7bfed97f9
[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.yeelight.internal.lib.device;
14
15 import java.util.List;
16
17 import org.openhab.binding.yeelight.internal.lib.enums.ActiveMode;
18 import org.openhab.binding.yeelight.internal.lib.enums.DeviceMode;
19
20 /**
21  * @author Coaster Li - Initial contribution
22  */
23 public class DeviceStatus {
24
25     public static final int MODE_COLOR = 1;
26     public static final int MODE_COLORTEMPERATURE = 2;
27     public static final int MODE_HSV = 3;
28
29     public static final int DEFAULT_NO_DELAY = -1;
30
31     private boolean isPowerOff;
32     private int r;
33     private int g;
34     private int b;
35     private int color;
36     private int brightness;
37     private int ct;
38     private int hue;
39     private int sat;
40     private boolean isFlowing;
41     private int delayOff = DEFAULT_NO_DELAY;
42     private List<ColorFlowItem> mFlowItems;
43     private DeviceMode mode;
44     private boolean isMusicOn;
45     private String name;
46     private int flowEndAction;
47     private int flowCount;
48
49     private int backgroundBrightness;
50     private boolean backgroundIsPowerOff;
51     private int backgroundR;
52     private int backgroundG;
53     private int backgroundB;
54     private int backgroundHue;
55     private int backgroundSat;
56
57     private ActiveMode activeMode;
58
59     public int getR() {
60         return r;
61     }
62
63     public void setR(int r) {
64         this.r = r;
65     }
66
67     public int getG() {
68         return g;
69     }
70
71     public void setG(int g) {
72         this.g = g;
73     }
74
75     public int getB() {
76         return b;
77     }
78
79     public void setB(int b) {
80         this.b = b;
81     }
82
83     public int getBrightness() {
84         return brightness;
85     }
86
87     public void setBrightness(int brightness) {
88         this.brightness = brightness;
89     }
90
91     public int getCt() {
92         return ct;
93     }
94
95     public void setCt(int ct) {
96         this.ct = ct;
97     }
98
99     public int getHue() {
100         return hue;
101     }
102
103     public void setHue(int hue) {
104         this.hue = hue;
105     }
106
107     public int getSat() {
108         return sat;
109     }
110
111     public void setSat(int sat) {
112         this.sat = sat;
113     }
114
115     public DeviceMode getMode() {
116         return mode;
117     }
118
119     public void setMode(DeviceMode mode) {
120         this.mode = mode;
121     }
122
123     public boolean isPowerOff() {
124         return isPowerOff;
125     }
126
127     public void setPowerOff(boolean isPowerOff) {
128         this.isPowerOff = isPowerOff;
129     }
130
131     public int getColor() {
132         return color;
133     }
134
135     public void setColor(int color) {
136         this.color = color;
137     }
138
139     public boolean getIsFlowing() {
140         return isFlowing;
141     }
142
143     public void setIsFlowing(boolean isFlowing) {
144         this.isFlowing = isFlowing;
145     }
146
147     public List<ColorFlowItem> getFlowItems() {
148         return mFlowItems;
149     }
150
151     public void setFlowItems(List<ColorFlowItem> mFlowItems) {
152         this.mFlowItems = mFlowItems;
153     }
154
155     public boolean isMusicOn() {
156         return isMusicOn;
157     }
158
159     public void setMusicOn(boolean isMusicOn) {
160         this.isMusicOn = isMusicOn;
161     }
162
163     public String getName() {
164         return name;
165     }
166
167     public void setName(String name) {
168         this.name = name;
169     }
170
171     public int getDelayOff() {
172         return delayOff;
173     }
174
175     public void setDelayOff(int delayOff) {
176         this.delayOff = delayOff;
177     }
178
179     public boolean isBackgroundIsPowerOff() {
180         return backgroundIsPowerOff;
181     }
182
183     public void setBackgroundIsPowerOff(boolean backgroundIsPowerOff) {
184         this.backgroundIsPowerOff = backgroundIsPowerOff;
185     }
186
187     public int getBackgroundR() {
188         return backgroundR;
189     }
190
191     public void setBackgroundR(int backgroundR) {
192         this.backgroundR = backgroundR;
193     }
194
195     public int getBackgroundG() {
196         return backgroundG;
197     }
198
199     public void setBackgroundG(int backgroundG) {
200         this.backgroundG = backgroundG;
201     }
202
203     public int getBackgroundB() {
204         return backgroundB;
205     }
206
207     public void setBackgroundB(int backgroundB) {
208         this.backgroundB = backgroundB;
209     }
210
211     public int getBackgroundHue() {
212         return backgroundHue;
213     }
214
215     public void setBackgroundHue(int backgroundHue) {
216         this.backgroundHue = backgroundHue;
217     }
218
219     public int getBackgroundBrightness() {
220         return backgroundBrightness;
221     }
222
223     public void setBackgroundBrightness(int backgroundBrightness) {
224         this.backgroundBrightness = backgroundBrightness;
225     }
226
227     public int getBackgroundSat() {
228         return backgroundSat;
229     }
230
231     public void setBackgroundSat(int backgroundSat) {
232         this.backgroundSat = backgroundSat;
233     }
234
235     public ActiveMode getActiveMode() {
236         return activeMode;
237     }
238
239     public void setActiveMode(ActiveMode activeMode) {
240         this.activeMode = activeMode;
241     }
242
243     @Override
244     public String toString() {
245         return "DeviceStatus [isPowerOff=" + isPowerOff + ", r=" + r + ", g=" + g + ", b=" + b + ", color=" + color
246                 + ", brightness=" + brightness + ", ct=" + ct + ", hue=" + hue + ", sat=" + sat + ", isFlowing="
247                 + isFlowing + ", delayOff=" + delayOff + ", mFlowItems=" + mFlowItems + ", mode=" + mode
248                 + ", isMusicOn=" + isMusicOn + ", name=" + name + ", backgroundIsPowerOff=" + backgroundIsPowerOff
249                 + ", backgroundR=" + backgroundR + ", backgroundG=" + backgroundG + ", backgroundB=" + backgroundB
250                 + ", backgroundHue=" + backgroundHue + ", backgroundBrightness=" + backgroundBrightness
251                 + ", backgroundSat=" + backgroundSat + ", activeMode=" + activeMode + "]";
252     }
253
254     public int getFlowCount() {
255         return flowCount;
256     }
257
258     public void setFlowCount(int flowCount) {
259         this.flowCount = flowCount;
260     }
261
262     public int getFlowEndAction() {
263         return flowEndAction;
264     }
265
266     public void setFlowEndAction(int flowEndAction) {
267         this.flowEndAction = flowEndAction;
268     }
269 }