JLChen
2021-08-06 47675876dbc24ea2fa54a1f4090f1a998ed2e5cf
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/SensorActivity.java
@@ -9,6 +9,7 @@
import com.hdl.sdk.hdl_core.HDLAppliances.Config.HDLApConfig;
import com.hdl.sdk.hdl_core.HDLAppliances.HDLSensor.SensorStateBackInfo;
import com.hdl.sdk.hdl_core.HDLDeviceManger.Bean.AppliancesInfo;
import com.hdl.sdk.hdl_core.HDLDeviceManger.Core.HDLCommand;
import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.DryContactSensorBackEvent;
@@ -56,7 +57,7 @@
        initOnClick();
        displayStateView();
        //从网络上查询刷新一次设备状态,待调试
        HDLCommand.getDryContactSensorStateFromNetwork(appliancesInfo);
        HDLCommand.getSensorStateFromNetwork(appliancesInfo);
    }
    /**
@@ -94,7 +95,7 @@
            @Override
            public void onClick(View view) {
                //从网络上查询刷新一次设备状态,待调试
                HDLCommand.getDryContactSensorStateFromNetwork(appliancesInfo);
                HDLCommand.getSensorStateFromNetwork(appliancesInfo);
            }
        });
    }
@@ -102,33 +103,34 @@
    private void displayStateView() {
        switch (appliancesInfo.getDeviceType()) {
//            case HDLApConfig.TYPE_SENSOR_TEMP:////2019-07-03 屏蔽
//            case HDLApConfig.TYPE_SENSOR_HUMIDITY:
//            case HDLApConfig.TYPE_SENSOR_ILLUMINACE:
//            case HDLApConfig.TYPE_SENSOR_VOC:
//            case HDLApConfig.TYPE_SENSOR_PM_2_POINT_5:
//            case HDLApConfig.TYPE_SENSOR_C02:
//            case HDLApConfig.TYPE_SENSOR_LPG:
            case HDLApConfig.TYPE_SENSOR_TEMP:////2019-07-03 屏蔽
            case HDLApConfig.TYPE_SENSOR_HUMIDITY:
            case HDLApConfig.TYPE_SENSOR_ILLUMINACE:
            case HDLApConfig.TYPE_SENSOR_VOC:
            case HDLApConfig.TYPE_SENSOR_PM_2_POINT_5:
            case HDLApConfig.TYPE_SENSOR_C02:
            case HDLApConfig.TYPE_SENSOR_LPG:
//            case HDLApConfig.TYPE_SENSOR_CO_H2:
//            case HDLApConfig.TYPE_SENSOR_CH4:
            case HDLApConfig.TYPE_SENSOR_CH4:
//            case HDLApConfig.TYPE_SENSOR_SMOG:
//            case HDLApConfig.TYPE_SENSOR_WIND_SPEED:
//            case HDLApConfig.TYPE_SENSOR_WIND_PRESSURE:
//            case HDLApConfig.TYPE_SENSOR_LIQUID_FLOW:
//            case HDLApConfig.TYPE_SENSOR_LIQUID_PRESSURE:
//            case HDLApConfig.TYPE_SENSOR_LIQUID_DEPTH:
//            case HDLApConfig.TYPE_SENSOR_RAIN_FALL:
//            case HDLApConfig.TYPE_SENSOR_WEIGHT:
//            case HDLApConfig.TYPE_SENSOR_HEIGHT_LENGTH:
//            case HDLApConfig.TYPE_SENSOR_OBJECT_SPEED:
//            case HDLApConfig.TYPE_SENSOR_SHAKE:
//            case HDLApConfig.TYPE_SENSOR_VOLTAGE:
//            case HDLApConfig.TYPE_SENSOR_ELECTRICITY:
//            case HDLApConfig.TYPE_SENSOR_POWER:
            case HDLApConfig.TYPE_SENSOR_WIND_SPEED:
            case HDLApConfig.TYPE_SENSOR_WIND_PRESSURE:
            case HDLApConfig.TYPE_SENSOR_LIQUID_FLOW:
            case HDLApConfig.TYPE_SENSOR_LIQUID_PRESSURE:
            case HDLApConfig.TYPE_SENSOR_LIQUID_DEPTH:
            case HDLApConfig.TYPE_SENSOR_RAIN_FALL:
            case HDLApConfig.TYPE_SENSOR_WEIGHT:
            case HDLApConfig.TYPE_SENSOR_HEIGHT_LENGTH:
            case HDLApConfig.TYPE_SENSOR_OBJECT_SPEED:
            case HDLApConfig.TYPE_SENSOR_SHAKE:
            case HDLApConfig.TYPE_SENSOR_VOLTAGE:
            case HDLApConfig.TYPE_SENSOR_ELECTRICITY:
            case HDLApConfig.TYPE_SENSOR_POWER:
//            case HDLApConfig.TYPE_SENSOR_FLOODING:
//            case HDLApConfig.TYPE_SENSOR_DOOR_MAGNET:
//            case HDLApConfig.TYPE_SENSOR_EMERGENCY_BUTTON:
//
//          下面的都是用干节点指令
            case HDLApConfig.TYPE_SENSOR_DRY_CONTACT: //干节点
            case HDLApConfig.TYPE_SENSOR_MOVEMENT_DETECTOR: //红外感应传感器
            case HDLApConfig.TYPE_SENSOR_CO_H2:         //煤气传感器
@@ -177,29 +179,30 @@
    }
//    /**
//     * 传感器状态回调 Event
//     *
//     * @param event
//     */
//    @Subscribe(threadMode = ThreadMode.MAIN)
//    public void onSensorStateBackInfoMain(SensorStateBackInfo event) {
//        if (event.getAppliancesInfo().getDeviceSubnetID() == appliancesInfo.getDeviceSubnetID()
//                && event.getAppliancesInfo().getDeviceDeviceID() == appliancesInfo.getDeviceDeviceID()
//                && event.getAppliancesInfo().getChannelNum() == appliancesInfo.getChannelNum()
//        ) {
//            //这个返回的信息是当前状态的
//            switch (event.getAppliancesInfo().getDeviceType()) {
//                case HDLApConfig.TYPE_SENSOR_DRY_CONTACT://2019-07-03 屏蔽
    /**
     * 传感器状态回调 Event
     *
     * @param event
     */
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onSensorStateBackInfoMain(SensorStateBackInfo event) {
        if (event.getAppliancesInfo().getDeviceSubnetID() == appliancesInfo.getDeviceSubnetID()
                && event.getAppliancesInfo().getDeviceDeviceID() == appliancesInfo.getDeviceDeviceID()
                && event.getAppliancesInfo().getChannelNum() == appliancesInfo.getChannelNum()
                && event.getAppliancesInfo().getDeviceType() == appliancesInfo.getDeviceType()//设备类型也要匹配解决混合回路
        ) {
            //这个返回的信息是当前状态的
            switch (event.getAppliancesInfo().getDeviceType()) {
//                case HDLApConfig.TYPE_SENSOR_DRY_CONTACT:
//                    //传感器 干接点 。只有开关状态
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---干接点状态失败,请重新再试");
//                        return;
//                    }
//                    float dryContactValue = (float) event.getAppliancesInfo().getCurState();
//                    float dryContactValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String dryContactUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---干接点状态:" + dryContactValue + dryContactUnit);
//                    HDLLog.Log("传感器---干接点状态:" + dryContactValue + dryContactUnit);
//                    HDLLog.I("传感器---干接点状态:" + dryContactValue + dryContactUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_MOVEMENT_DETECTOR:
//                    //传感器 移动探测 。灵敏度
@@ -207,274 +210,274 @@
//                        showToast("获取传感器---移动探测灵敏度状态失败,请重新再试");
//                        return;
//                    }
//                    float mdValue = (float) event.getAppliancesInfo().getCurState();
//                    float mdValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String mdValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---移动探测灵敏度:" + mdValue + mdValueUnit);
//                    HDLLog.Log("传感器---移动探测灵敏度:" + mdValue + mdValueUnit);
//                    HDLLog.I("传感器---移动探测灵敏度:" + mdValue + mdValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_TEMP:
//                    //传感器 温度
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---温度状态失败,请重新再试");
//                        return;
//                    }
//                    float tempValue = (float) event.getAppliancesInfo().getCurState();
//                    String tempValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---温度:" + tempValue + tempValueUnit);
//                    HDLLog.Log("传感器---温度:" + tempValue + tempValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_HUMIDITY:
//                    //传感器 湿度
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---湿度状态失败,请重新再试");
//                        return;
//                    }
//                    float humidityValue = (float) event.getAppliancesInfo().getCurState();
//                    String humidityValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---湿度:" + humidityValue + humidityValueUnit);
//                    HDLLog.Log("传感器---湿度:" + humidityValue + humidityValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_ILLUMINACE:
//                    //传感器 照度
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---照度状态失败,请重新再试");
//                        return;
//                    }
//                    float illuminaceValue = (float) event.getAppliancesInfo().getCurState();
//                    String illuminaceValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---照度:" + illuminaceValue + illuminaceValueUnit);
//                    HDLLog.Log("传感器---照度:" + illuminaceValue + illuminaceValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_VOC:
//                    //传感器 当前空气质量等级
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---当前空气质量等级状态失败,请重新再试");
//                        return;
//                    }
//                    float vocValue = (float) event.getAppliancesInfo().getCurState();
//                    String vocValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---当前空气质量等级:" + vocValue + vocValueUnit);
//                    HDLLog.Log("传感器---当前空气质量等级:" + vocValue + vocValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_PM_2_POINT_5:
//                    //传感器 pm2.5
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---pm2.5状态失败,请重新再试");
//                        return;
//                    }
//                    float pm2_5Value = (float) event.getAppliancesInfo().getCurState();
//                    String pm2_5ValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---pm2.5:" + pm2_5Value + pm2_5ValueUnit);
//                    HDLLog.Log("传感器---pm2.5:" + pm2_5Value + pm2_5ValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_C02:
//                    //传感器 二氧化碳
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---二氧化碳状态失败,请重新再试");
//                        return;
//                    }
//                    float co2Value = (float) event.getAppliancesInfo().getCurState();
//                    String co2ValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---二氧化碳:" + co2Value + co2ValueUnit);
//                    HDLLog.Log("传感器---二氧化碳:" + co2Value + co2ValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_LPG:
//                    //传感器 液化石油气
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---液化石油气状态失败,请重新再试");
//                        return;
//                    }
//                    float lpgValue = (float) event.getAppliancesInfo().getCurState();
//                    String lpgValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---液化石油气:" + lpgValue + lpgValueUnit);
//                    HDLLog.Log("传感器---液化石油气:" + lpgValue + lpgValueUnit);
//                    break;
                case HDLApConfig.TYPE_SENSOR_TEMP:
                    //传感器 温度
                    if (!event.isSuccess()) {
                        showToast("获取传感器---温度状态失败,请重新再试");
                        return;
                    }
                    float tempValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String tempValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---温度:" + tempValue + tempValueUnit);
                    HDLLog.I("传感器---温度:" + tempValue + tempValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_HUMIDITY:
                    //传感器 湿度
                    if (!event.isSuccess()) {
                        showToast("获取传感器---湿度状态失败,请重新再试");
                        return;
                    }
                    float humidityValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String humidityValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---湿度:" + humidityValue + humidityValueUnit);
                    HDLLog.I("传感器---湿度:" + humidityValue + humidityValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_ILLUMINACE:
                    //传感器 照度
                    if (!event.isSuccess()) {
                        showToast("获取传感器---照度状态失败,请重新再试");
                        return;
                    }
                    float illuminaceValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String illuminaceValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---照度:" + illuminaceValue + illuminaceValueUnit);
                    HDLLog.I("传感器---照度:" + illuminaceValue + illuminaceValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_VOC:
                    //传感器 当前空气质量等级
                    if (!event.isSuccess()) {
                        showToast("获取传感器---当前空气质量等级状态失败,请重新再试");
                        return;
                    }
                    float vocValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String vocValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---当前空气质量等级:" + vocValue + vocValueUnit);
                    HDLLog.I("传感器---当前空气质量等级:" + vocValue + vocValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_PM_2_POINT_5:
                    //传感器 pm2.5
                    if (!event.isSuccess()) {
                        showToast("获取传感器---pm2.5状态失败,请重新再试");
                        return;
                    }
                    float pm2_5Value = (float) event.getAppliancesInfo().getCurStateObject();
                    String pm2_5ValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---pm2.5:" + pm2_5Value + pm2_5ValueUnit);
                    HDLLog.I("传感器---pm2.5:" + pm2_5Value + pm2_5ValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_C02:
                    //传感器 二氧化碳
                    if (!event.isSuccess()) {
                        showToast("获取传感器---二氧化碳状态失败,请重新再试");
                        return;
                    }
                    float co2Value = (float) event.getAppliancesInfo().getCurStateObject();
                    String co2ValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---二氧化碳:" + co2Value + co2ValueUnit);
                    HDLLog.I("传感器---二氧化碳:" + co2Value + co2ValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_LPG:
                    //传感器 液化石油气
                    if (!event.isSuccess()) {
                        showToast("获取传感器---液化石油气状态失败,请重新再试");
                        return;
                    }
                    float lpgValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String lpgValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---液化石油气:" + lpgValue + lpgValueUnit);
                    HDLLog.I("传感器---液化石油气:" + lpgValue + lpgValueUnit);
                    break;
//                case HDLApConfig.TYPE_SENSOR_CO_H2:
//                    //传感器 人工煤气
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---人工煤气状态失败,请重新再试");
//                        return;
//                    }
//                    float coh2Value = (float) event.getAppliancesInfo().getCurState();
//                    float coh2Value = (float) event.getAppliancesInfo().getCurStateObject();
//                    String coh2ValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---人工煤气:" + coh2Value + coh2ValueUnit);
//                    HDLLog.Log("传感器---人工煤气:" + coh2Value + coh2ValueUnit);
//                    HDLLog.I("传感器---人工煤气:" + coh2Value + coh2ValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_CH4:
//                    //传感器 天然气
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---天然气状态失败,请重新再试");
//                        return;
//                    }
//                    float ch4Value = (float) event.getAppliancesInfo().getCurState();
//                    String ch4ValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---天然气:" + ch4Value + ch4ValueUnit);
//                    HDLLog.Log("传感器---天然气:" + ch4Value + ch4ValueUnit);
//                    break;
                case HDLApConfig.TYPE_SENSOR_CH4:
                    //传感器 天然气
                    if (!event.isSuccess()) {
                        showToast("获取传感器---天然气状态失败,请重新再试");
                        return;
                    }
                    float ch4Value = (float) event.getAppliancesInfo().getCurStateObject();
                    String ch4ValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---天然气:" + ch4Value + ch4ValueUnit);
                    HDLLog.I("传感器---天然气:" + ch4Value + ch4ValueUnit);
                    break;
//                case HDLApConfig.TYPE_SENSOR_SMOG:
//                    //传感器 烟雾
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---烟雾状态失败,请重新再试");
//                        return;
//                    }
//                    float smogValue = (float) event.getAppliancesInfo().getCurState();
//                    float smogValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String smogValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---烟雾:" + smogValue + smogValueUnit);
//                    HDLLog.Log("传感器---烟雾:" + smogValue + smogValueUnit);
//                    HDLLog.I("传感器---烟雾:" + smogValue + smogValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_WIND_SPEED:
//                    //传感器 风速
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---风速状态失败,请重新再试");
//                        return;
//                    }
//                    float windSpeedValue = (float) event.getAppliancesInfo().getCurState();
//                    String windSpeedValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---风速:" + windSpeedValue + windSpeedValueUnit);
//                    HDLLog.Log("传感器---风速:" + windSpeedValue + windSpeedValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_WIND_PRESSURE:
//                    //传感器 风压
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---风压状态失败,请重新再试");
//                        return;
//                    }
//                    float windPressureValue = (float) event.getAppliancesInfo().getCurState();
//                    String windPressureValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---风压:" + windPressureValue + windPressureValueUnit);
//                    HDLLog.Log("传感器---风压:" + windPressureValue + windPressureValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_LIQUID_FLOW:
//                    //传感器 液体流量
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---液体流量状态失败,请重新再试");
//                        return;
//                    }
//                    float liquidFlowValue = (float) event.getAppliancesInfo().getCurState();
//                    String liquidFlowValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---液体流量:" + liquidFlowValue + liquidFlowValueUnit);
//                    HDLLog.Log("传感器---液体流量:" + liquidFlowValue + liquidFlowValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_LIQUID_PRESSURE:
//                    //传感器 液体压力
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---液体压力状态失败,请重新再试");
//                        return;
//                    }
//                    float liquidPressureValue = (float) event.getAppliancesInfo().getCurState();
//                    String liquidPressureValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---液体压力:" + liquidPressureValue + liquidPressureValueUnit);
//                    HDLLog.Log("传感器---液体压力:" + liquidPressureValue + liquidPressureValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_LIQUID_DEPTH:
//                    //传感器 液体深度
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---液体深度状态失败,请重新再试");
//                        return;
//                    }
//                    float liquidDepthValue = (float) event.getAppliancesInfo().getCurState();
//                    String liquidDepthValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---液体深度:" + liquidDepthValue + liquidDepthValueUnit);
//                    HDLLog.Log("传感器---液体深度:" + liquidDepthValue + liquidDepthValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_RAIN_FALL:
//                    //传感器 雨量
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---雨量状态失败,请重新再试");
//                        return;
//                    }
//                    float rainFallValue = (float) event.getAppliancesInfo().getCurState();
//                    String rainFallValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---雨量:" + rainFallValue + rainFallValueUnit);
//                    HDLLog.Log("传感器---雨量:" + rainFallValue + rainFallValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_WEIGHT:
//                    //传感器 重量
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---重量状态失败,请重新再试");
//                        return;
//                    }
//                    float weightValue = (float) event.getAppliancesInfo().getCurState();
//                    String weightValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---重量:" + weightValue + weightValueUnit);
//                    HDLLog.Log("传感器---重量:" + weightValue + weightValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_HEIGHT_LENGTH:
//                    //传感器 重量
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---重量状态失败,请重新再试");
//                        return;
//                    }
//                    float height_lengthValue = (float) event.getAppliancesInfo().getCurState();
//                    String height_lengthValueUnit = ((SensorStateBackInfo) event).getUnite();
//                    showToast("传感器---重量:" + height_lengthValue + height_lengthValueUnit);
//                    HDLLog.Log("传感器---重量:" + height_lengthValue + height_lengthValueUnit);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_OBJECT_SPEED:
//                    //传感器 物体速度
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---物体速度状态失败,请重新再试");
//                        return;
//                    }
//                    float objectSpeedValue = (float) event.getAppliancesInfo().getCurState();
//                    String objectSpeedUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---物体速度:" + objectSpeedValue + objectSpeedUnite);
//                    HDLLog.Log("传感器---物体速度:" + objectSpeedValue + objectSpeedUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_SHAKE:
//                    //传感器 震动
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---震动状态失败,请重新再试");
//                        return;
//                    }
//                    float shakeValue = (float) event.getAppliancesInfo().getCurState();
//                    String shakeValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---震动:" + shakeValue + shakeValueUnite);
//                    HDLLog.Log("传感器---震动:" + shakeValue + shakeValueUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_VOLTAGE:
//                    //传感器 电压
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---电压状态失败,请重新再试");
//                        return;
//                    }
//                    float voltageValue = (float) event.getAppliancesInfo().getCurState();
//                    String voltageValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---电压:" + voltageValue + voltageValueUnite);
//                    HDLLog.Log("传感器---电压:" + voltageValue + voltageValueUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_ELECTRICITY:
//                    //传感器 电流
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---电流状态失败,请重新再试");
//                        return;
//                    }
//                    float electricityValue = (float) event.getAppliancesInfo().getCurState();
//                    String electricityValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---电流:" + electricityValue + electricityValueUnite);
//                    HDLLog.Log("传感器---电流:" + electricityValue + electricityValueUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_POWER:
//                    //传感器 功率
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---功率状态失败,请重新再试");
//                        return;
//                    }
//                    float powerValue = (float) event.getAppliancesInfo().getCurState();
//                    String powerValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---功率:" + powerValue + powerValueUnite);
//                    HDLLog.Log("传感器---功率:" + powerValue + powerValueUnite);
//                    break;
                case HDLApConfig.TYPE_SENSOR_WIND_SPEED:
                    //传感器 风速
                    if (!event.isSuccess()) {
                        showToast("获取传感器---风速状态失败,请重新再试");
                        return;
                    }
                    float windSpeedValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String windSpeedValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---风速:" + windSpeedValue + windSpeedValueUnit);
                    HDLLog.I("传感器---风速:" + windSpeedValue + windSpeedValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_WIND_PRESSURE:
                    //传感器 风压
                    if (!event.isSuccess()) {
                        showToast("获取传感器---风压状态失败,请重新再试");
                        return;
                    }
                    float windPressureValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String windPressureValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---风压:" + windPressureValue + windPressureValueUnit);
                    HDLLog.I("传感器---风压:" + windPressureValue + windPressureValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_LIQUID_FLOW:
                    //传感器 液体流量
                    if (!event.isSuccess()) {
                        showToast("获取传感器---液体流量状态失败,请重新再试");
                        return;
                    }
                    float liquidFlowValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String liquidFlowValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---液体流量:" + liquidFlowValue + liquidFlowValueUnit);
                    HDLLog.I("传感器---液体流量:" + liquidFlowValue + liquidFlowValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_LIQUID_PRESSURE:
                    //传感器 液体压力
                    if (!event.isSuccess()) {
                        showToast("获取传感器---液体压力状态失败,请重新再试");
                        return;
                    }
                    float liquidPressureValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String liquidPressureValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---液体压力:" + liquidPressureValue + liquidPressureValueUnit);
                    HDLLog.I("传感器---液体压力:" + liquidPressureValue + liquidPressureValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_LIQUID_DEPTH:
                    //传感器 液体深度
                    if (!event.isSuccess()) {
                        showToast("获取传感器---液体深度状态失败,请重新再试");
                        return;
                    }
                    float liquidDepthValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String liquidDepthValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---液体深度:" + liquidDepthValue + liquidDepthValueUnit);
                    HDLLog.I("传感器---液体深度:" + liquidDepthValue + liquidDepthValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_RAIN_FALL:
                    //传感器 雨量
                    if (!event.isSuccess()) {
                        showToast("获取传感器---雨量状态失败,请重新再试");
                        return;
                    }
                    float rainFallValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String rainFallValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---雨量:" + rainFallValue + rainFallValueUnit);
                    HDLLog.I("传感器---雨量:" + rainFallValue + rainFallValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_WEIGHT:
                    //传感器 重量
                    if (!event.isSuccess()) {
                        showToast("获取传感器---重量状态失败,请重新再试");
                        return;
                    }
                    float weightValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String weightValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---重量:" + weightValue + weightValueUnit);
                    HDLLog.I("传感器---重量:" + weightValue + weightValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_HEIGHT_LENGTH:
                    //传感器 重量
                    if (!event.isSuccess()) {
                        showToast("获取传感器---重量状态失败,请重新再试");
                        return;
                    }
                    float height_lengthValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String height_lengthValueUnit = ((SensorStateBackInfo) event).getUnite();
                    showToast("传感器---重量:" + height_lengthValue + height_lengthValueUnit);
                    HDLLog.I("传感器---重量:" + height_lengthValue + height_lengthValueUnit);
                    break;
                case HDLApConfig.TYPE_SENSOR_OBJECT_SPEED:
                    //传感器 物体速度
                    if (!event.isSuccess()) {
                        showToast("获取传感器---物体速度状态失败,请重新再试");
                        return;
                    }
                    float objectSpeedValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String objectSpeedUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
                    showToast("传感器---物体速度:" + objectSpeedValue + objectSpeedUnite);
                    HDLLog.I("传感器---物体速度:" + objectSpeedValue + objectSpeedUnite);
                    break;
                case HDLApConfig.TYPE_SENSOR_SHAKE:
                    //传感器 震动
                    if (!event.isSuccess()) {
                        showToast("获取传感器---震动状态失败,请重新再试");
                        return;
                    }
                    float shakeValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String shakeValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
                    showToast("传感器---震动:" + shakeValue + shakeValueUnite);
                    HDLLog.I("传感器---震动:" + shakeValue + shakeValueUnite);
                    break;
                case HDLApConfig.TYPE_SENSOR_VOLTAGE:
                    //传感器 电压
                    if (!event.isSuccess()) {
                        showToast("获取传感器---电压状态失败,请重新再试");
                        return;
                    }
                    float voltageValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String voltageValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
                    showToast("传感器---电压:" + voltageValue + voltageValueUnite);
                    HDLLog.I("传感器---电压:" + voltageValue + voltageValueUnite);
                    break;
                case HDLApConfig.TYPE_SENSOR_ELECTRICITY:
                    //传感器 电流
                    if (!event.isSuccess()) {
                        showToast("获取传感器---电流状态失败,请重新再试");
                        return;
                    }
                    float electricityValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String electricityValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
                    showToast("传感器---电流:" + electricityValue + electricityValueUnite);
                    HDLLog.I("传感器---电流:" + electricityValue + electricityValueUnite);
                    break;
                case HDLApConfig.TYPE_SENSOR_POWER:
                    //传感器 功率
                    if (!event.isSuccess()) {
                        showToast("获取传感器---功率状态失败,请重新再试");
                        return;
                    }
                    float powerValue = (float) event.getAppliancesInfo().getCurStateObject();
                    String powerValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
                    showToast("传感器---功率:" + powerValue + powerValueUnite);
                    HDLLog.I("传感器---功率:" + powerValue + powerValueUnite);
                    break;
//                case HDLApConfig.TYPE_SENSOR_FLOODING:
//                    //传感器 水浸
//                    if (!event.isSuccess()) {
//                        showToast("获取传感器---水浸状态失败,请重新再试");
//                        return;
//                    }
//                    float floodingValue = (float) event.getAppliancesInfo().getCurState();
//                    float floodingValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String floodingValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---水浸:" + floodingValue + floodingValueUnite);
//                    HDLLog.Log("传感器---水浸:" + floodingValue + floodingValueUnite);
//                    HDLLog.I("传感器---水浸:" + floodingValue + floodingValueUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_DOOR_MAGNET:
//                    //传感器 门磁窗磁
@@ -482,10 +485,10 @@
//                        showToast("获取传感器---门磁窗磁状态失败,请重新再试");
//                        return;
//                    }
//                    float doorMagnetValue = (float) event.getAppliancesInfo().getCurState();
//                    float doorMagnetValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String doorMagnetValueUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---门磁窗磁:" + doorMagnetValue + doorMagnetValueUnite);
//                    HDLLog.Log("传感器---门磁窗磁:" + doorMagnetValue + doorMagnetValueUnite);
//                    HDLLog.I("传感器---门磁窗磁:" + doorMagnetValue + doorMagnetValueUnite);
//                    break;
//                case HDLApConfig.TYPE_SENSOR_EMERGENCY_BUTTON:
//                    //传感器 紧急按钮
@@ -493,15 +496,15 @@
//                        showToast("获取传感器---紧急按钮状态失败,请重新再试");
//                        return;
//                    }
//                    float emergencyButtonValue = (float) event.getAppliancesInfo().getCurState();
//                    float emergencyButtonValue = (float) event.getAppliancesInfo().getCurStateObject();
//                    String emergencyButtonUnite = ((SensorStateBackInfo) event).getUnite();//数值单位
//                    showToast("传感器---紧急按钮:" + emergencyButtonValue + emergencyButtonUnite);
//                    HDLLog.Log("传感器---紧急按钮:" + emergencyButtonValue + emergencyButtonUnite);
//                    HDLLog.I("传感器---紧急按钮:" + emergencyButtonValue + emergencyButtonUnite);
//                    break;
//
//
//            }
//        }
//    }
            }
        }
    }
}