From 52f8575a2fa0590c28b5d784399c51a8af2f790a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 28 二月 2020 15:26:04 +0800
Subject: [PATCH] 2020-2-28 1.增加小类是3的音乐播放器支持

---
 hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java |   98 +++++++++++++++++++++++++-----------------------
 1 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
index ed821a7..f8ede67 100644
--- a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
+++ b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
@@ -671,60 +671,64 @@
                         List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                         inner:
                         for (int j = 0, len2 = infos.size(); j < len2; j++) {
-                            AppliancesInfo curtainInfo;
-                            if ((getDatas.addBytes[0] & 0xFF) >= 17) {
-                                if (((getDatas.addBytes[0] & 0xFF) - 16) == infos.get(j).getChannelNum()) {
-                                    curtainInfo = infos.get(j);
-                                } else {
-                                    continue inner;
-                                }
-                            } else {
-                                if ((getDatas.addBytes[0] & 0xFF) == infos.get(j).getChannelNum()) {
-                                    curtainInfo = infos.get(j);
-                                } else {
-                                    continue inner;
-                                }
-                            }
+                            if(infos.get(j).getDeviceType() == HDLApConfig.TYPE_CURTAIN_GLYSTRO
+                                    || infos.get(j).getDeviceType() == HDLApConfig.TYPE_CURTAIN_ROLLER
+                                    || infos.get(j).getDeviceType() == HDLApConfig.TYPE_CURTAIN_MODULE
+                            ) {
 
-                            CurtainCtrlBackInfo curtainCtrlBackInfo = new CurtainCtrlBackInfo();
-                            curtainCtrlBackInfo.setRemarks(curtainInfo.getRemarks());
-                            curtainCtrlBackInfo.setParentRemarks(curtainInfo.getParentRemarks());
-                            curtainCtrlBackInfo.setAppliancesInfo(curtainInfo);
-//                            isCurtainCtrlSuccess = true;
-                            setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
-
-                            if (curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_GLYSTRO
-                                    || curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_ROLLER) {
+                                AppliancesInfo curtainInfo;
                                 if ((getDatas.addBytes[0] & 0xFF) >= 17) {
-                                    int curState = getDatas.addBytes[1] & 0xFF;
-                                    if (curState == 1) {
-                                        //杩欎釜鍒ゆ柇寰堝偦锛岀獥甯樺叧鍒扮櫨鍒嗘瘮涓�0锛屼細璺冲埌1杩斿洖鍥炴潵锛屽彧鑳藉己鍒舵敼涓�0
-                                        curState = 0;
+                                    if (((getDatas.addBytes[0] & 0xFF) - 16) == infos.get(j).getChannelNum()) {
+                                        curtainInfo = infos.get(j);
+                                    } else {
+                                        continue inner;
                                     }
-                                    if (curState == 99) {
-                                        curState = 100;
+                                } else {
+                                    if ((getDatas.addBytes[0] & 0xFF) == infos.get(j).getChannelNum()) {
+                                        curtainInfo = infos.get(j);
+                                    } else {
+                                        continue inner;
                                     }
-                                    curtainCtrlBackInfo.setState(curState);
-                                    devicesDataList.get(i).getAppliancesInfoList().get(j).setCurState(curState);
-                                    devicesDataList.get(i).getAppliancesInfoList().get(j).setIntCurState(curState);
-                                    curtainCtrlBackInfo.setNum((getDatas.addBytes[0] & 0xFF) - 16);
-                                    EventBus.getDefault().post(new CurtainFeedBackEvent(curtainCtrlBackInfo, true));
                                 }
-                            }
-                            if (curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_MODULE) {
-                                if ((getDatas.addBytes[0] & 0xFF) < 17) {
-                                    curtainCtrlBackInfo.setState(getDatas.addBytes[1] & 0xFF);
-                                    curtainCtrlBackInfo.setNum(getDatas.addBytes[0] & 0xFF);
-                                    devicesDataList.get(i).getAppliancesInfoList().get(j).setCurState(getDatas.addBytes[1] & 0xFF);
-                                    devicesDataList.get(i).getAppliancesInfoList().get(j).setIntCurState(getDatas.addBytes[1] & 0xFF);
-                                    EventBus.getDefault().post(new CurtainFeedBackEvent(curtainCtrlBackInfo, true));
+
+                                CurtainCtrlBackInfo curtainCtrlBackInfo = new CurtainCtrlBackInfo();
+                                curtainCtrlBackInfo.setRemarks(curtainInfo.getRemarks());
+                                curtainCtrlBackInfo.setParentRemarks(curtainInfo.getParentRemarks());
+                                curtainCtrlBackInfo.setAppliancesInfo(curtainInfo);
+//                            isCurtainCtrlSuccess = true;
+                                setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
+
+                                if (curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_GLYSTRO
+                                        || curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_ROLLER) {
+                                    if ((getDatas.addBytes[0] & 0xFF) >= 17) {
+                                        int curState = getDatas.addBytes[1] & 0xFF;
+                                        if (curState == 1) {
+                                            //杩欎釜鍒ゆ柇寰堝偦锛岀獥甯樺叧鍒扮櫨鍒嗘瘮涓�0锛屼細璺冲埌1杩斿洖鍥炴潵锛屽彧鑳藉己鍒舵敼涓�0
+                                            curState = 0;
+                                        }
+                                        if (curState == 99) {
+                                            curState = 100;
+                                        }
+                                        curtainCtrlBackInfo.setState(curState);
+                                        devicesDataList.get(i).getAppliancesInfoList().get(j).setCurState(curState);
+                                        devicesDataList.get(i).getAppliancesInfoList().get(j).setIntCurState(curState);
+                                        curtainCtrlBackInfo.setNum((getDatas.addBytes[0] & 0xFF) - 16);
+                                        EventBus.getDefault().post(new CurtainFeedBackEvent(curtainCtrlBackInfo, true));
+                                    }
                                 }
+                                if (curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_MODULE) {
+                                    if ((getDatas.addBytes[0] & 0xFF) < 17) {
+                                        curtainCtrlBackInfo.setState(getDatas.addBytes[1] & 0xFF);
+                                        curtainCtrlBackInfo.setNum(getDatas.addBytes[0] & 0xFF);
+                                        devicesDataList.get(i).getAppliancesInfoList().get(j).setCurState(getDatas.addBytes[1] & 0xFF);
+                                        devicesDataList.get(i).getAppliancesInfoList().get(j).setIntCurState(getDatas.addBytes[1] & 0xFF);
+                                        EventBus.getDefault().post(new CurtainFeedBackEvent(curtainCtrlBackInfo, true));
+                                    }
+                                }
+
+                                break outter;
+
                             }
-
-
-                            break outter;
-
-
                         }
                     }
                 }

--
Gitblit v1.8.0