2021与蓝度共同重构项目,服务端
Van333
2022-12-29 727a69f859060093e685582fa10e5de82dcc138a
ximon-admin/src/main/java/com/sandu/ximon/admin/manager/iot/frame/inner/request/A5LightBrightnessReqInnerFrame.java
@@ -21,15 +21,20 @@
    /**
     * @param lightLevel 亮度等级 [0,100]
     */
    public A5LightBrightnessReqInnerFrame(Integer lightLevel) {
        String destinationAddress = "FFFF";
    public A5LightBrightnessReqInnerFrame(Integer lightLevel, String lightAddress) {
        String destinationAddress;
        if (lightAddress == null || (!lightAddress.equals("0001") && !lightAddress.equals("0002"))) {
            destinationAddress = "FFFF";
        } else {
            destinationAddress = lightAddress;
        }
        //  将整型亮度转换为Hex
        if (lightLevel < 0) {
            lightLevel = 0;
        } else if (lightLevel > 100) {
            lightLevel = 100;
        }
        payload = destinationAddress + SupplementUtils.suppleZero(Integer.toHexString(lightLevel), 2);
        payload = destinationAddress + SupplementUtils.suppleZero(Integer.toHexString(lightLevel).toUpperCase(), 2);
    }
    @Override