JLChen
2021-09-03 fb0dac414a5422139ea805923bde0884f055f58d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.hdl.sdk.hdl_core.HDLAppliances.HDLLight;
 
import com.hdl.sdk.hdl_core.HDLDeviceManger.Bean.AppliancesInfo;
 
/**
 * Created by JLChen on 2020/10/20
 */
public class CCTBackInfo {
    private AppliancesInfo appliancesInfo;
    private int brightness; //亮度
    private int lightType; //1-5//1单路 2CCT 3RGB 4RGBW 5RGBWY
    private int cctValue; //当前色温值
    private byte[] curState;//控制回馈信息
 
    public int getCctValue() {
        return cctValue;
    }
 
    public void setCctValue(int cctValue) {
        this.cctValue = cctValue;
    }
 
    public CCTBackInfo() {
 
    }
 
    /**
     * GeothermalBackInfo
     * @param mAppliancesInfo
     */
    public CCTBackInfo(AppliancesInfo mAppliancesInfo) {
        this.appliancesInfo = mAppliancesInfo;
        this.curState = mAppliancesInfo.getFeedbackState();
        if (this.curState == null) return;
        if (this.curState.length >= 9) {
            this.brightness = this.curState[1] & 0xFF;
            this.lightType = this.curState[5] & 0xFF;
            int high = this.curState[6] & 0xFF;
            int low = this.curState[7] & 0xFF;
            this.cctValue = high * 256 + low;
        }
    }
 
    public AppliancesInfo getAppliancesInfo() {
        return appliancesInfo;
    }
 
    public void setAppliancesInfo(AppliancesInfo appliancesInfo) {
        this.appliancesInfo = appliancesInfo;
    }
 
    public int getBrightness() {
        return brightness;
    }
 
    public void setBrightness(int brightness) {
        this.brightness = brightness;
    }
 
    public int getLightType() {
        return lightType;
    }
 
    public void setLightType(int lightType) {
        this.lightType = lightType;
    }
 
    public byte[] getCurState() {
        return curState;
    }
 
    public void setCurState(byte[] curState) {
        this.curState = curState;
    }
 
}