JLChen
2020-02-28 52f8575a2fa0590c28b5d784399c51a8af2f790a
2020-2-28 1.增加小类是3的音乐播放器支持
5个文件已修改
113 ■■■■ 已修改文件
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/CtrlActivity.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLLight/LightCtrlBackInfo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HandleSearch.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Parser/DeviceParser.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/CtrlActivity.java
@@ -702,7 +702,10 @@
        if (event.getLightCtrlBackInfo().getAppliancesInfo().getDeviceDeviceID() == appliancesInfo.getDeviceDeviceID()
                && event.getLightCtrlBackInfo().getAppliancesInfo().getDeviceSubnetID() == appliancesInfo.getDeviceSubnetID()
                && event.getLightCtrlBackInfo().getChannelNum() == appliancesInfo.getChannelNum() && event.getLightCtrlBackInfo().getPhysicsChannelNum() == appliancesInfo.getPhysicsChannelNum()
                && event.getLightCtrlBackInfo().getChannelNum() == appliancesInfo.getChannelNum()
                && event.getLightCtrlBackInfo().getPhysicsChannelNum() == appliancesInfo.getPhysicsChannelNum()
                && event.getLightCtrlBackInfo().getAppliancesInfo().getDeviceType() == appliancesInfo.getDeviceType()
                ) {
            //        先判断是否超时
            if (!event.isSuccess()) {
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLLight/LightCtrlBackInfo.java
@@ -20,6 +20,7 @@
    String parentRemarks;//模块备注
    int physicsChannelNum;//RCU 灯光特有
    public String getParentRemarks() {
        return parentRemarks;
    }
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;
                        }
                    }
                }
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HandleSearch.java
@@ -509,6 +509,9 @@
        }
        if ((HDLDeviceManager.listRemarks != null && HDLDeviceManager.listRemarks.size() == 0) || isSearching) {
            isRefreshAllDevicesState = false;
            if(HDLDeviceManager.devicesDataList != null && HDLDeviceManager.devicesDataList.size() > 0){
                HandleSearch.OnDeviceListGetSuccessCallBack();
            }
            return;
        }
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Parser/DeviceParser.java
@@ -173,9 +173,9 @@
//                    case 1:
//                        isWant = true;
//                        break;
//                    case 3:
//                        isWant = true;
//                        break;
                    case 3:
                        isWant = true;
                        break;
                    default:
                        isWant = false;
                        break;