2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.yeelight.internal.lib.device;
15 import java.util.List;
17 import org.openhab.binding.yeelight.internal.lib.enums.ActiveMode;
18 import org.openhab.binding.yeelight.internal.lib.enums.DeviceMode;
21 * @author Coaster Li - Initial contribution
23 public class DeviceStatus {
25 public static final int MODE_COLOR = 1;
26 public static final int MODE_COLORTEMPERATURE = 2;
27 public static final int MODE_HSV = 3;
29 public static final int DEFAULT_NO_DELAY = -1;
31 private boolean isPowerOff;
36 private int brightness;
40 private boolean isFlowing;
41 private int delayOff = DEFAULT_NO_DELAY;
42 private List<ColorFlowItem> mFlowItems;
43 private DeviceMode mode;
44 private boolean isMusicOn;
46 private int flowEndAction;
47 private int flowCount;
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;
57 private ActiveMode activeMode;
63 public void setR(int r) {
71 public void setG(int g) {
79 public void setB(int b) {
83 public int getBrightness() {
87 public void setBrightness(int brightness) {
88 this.brightness = brightness;
95 public void setCt(int ct) {
103 public void setHue(int hue) {
107 public int getSat() {
111 public void setSat(int sat) {
115 public DeviceMode getMode() {
119 public void setMode(DeviceMode mode) {
123 public boolean isPowerOff() {
127 public void setPowerOff(boolean isPowerOff) {
128 this.isPowerOff = isPowerOff;
131 public int getColor() {
135 public void setColor(int color) {
139 public boolean getIsFlowing() {
143 public void setIsFlowing(boolean isFlowing) {
144 this.isFlowing = isFlowing;
147 public List<ColorFlowItem> getFlowItems() {
151 public void setFlowItems(List<ColorFlowItem> mFlowItems) {
152 this.mFlowItems = mFlowItems;
155 public boolean isMusicOn() {
159 public void setMusicOn(boolean isMusicOn) {
160 this.isMusicOn = isMusicOn;
163 public String getName() {
167 public void setName(String name) {
171 public int getDelayOff() {
175 public void setDelayOff(int delayOff) {
176 this.delayOff = delayOff;
179 public boolean isBackgroundIsPowerOff() {
180 return backgroundIsPowerOff;
183 public void setBackgroundIsPowerOff(boolean backgroundIsPowerOff) {
184 this.backgroundIsPowerOff = backgroundIsPowerOff;
187 public int getBackgroundR() {
191 public void setBackgroundR(int backgroundR) {
192 this.backgroundR = backgroundR;
195 public int getBackgroundG() {
199 public void setBackgroundG(int backgroundG) {
200 this.backgroundG = backgroundG;
203 public int getBackgroundB() {
207 public void setBackgroundB(int backgroundB) {
208 this.backgroundB = backgroundB;
211 public int getBackgroundHue() {
212 return backgroundHue;
215 public void setBackgroundHue(int backgroundHue) {
216 this.backgroundHue = backgroundHue;
219 public int getBackgroundBrightness() {
220 return backgroundBrightness;
223 public void setBackgroundBrightness(int backgroundBrightness) {
224 this.backgroundBrightness = backgroundBrightness;
227 public int getBackgroundSat() {
228 return backgroundSat;
231 public void setBackgroundSat(int backgroundSat) {
232 this.backgroundSat = backgroundSat;
235 public ActiveMode getActiveMode() {
239 public void setActiveMode(ActiveMode activeMode) {
240 this.activeMode = activeMode;
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 + "]";
254 public int getFlowCount() {
258 public void setFlowCount(int flowCount) {
259 this.flowCount = flowCount;
262 public int getFlowEndAction() {
263 return flowEndAction;
266 public void setFlowEndAction(int flowEndAction) {
267 this.flowEndAction = flowEndAction;