wei
2021-10-14 9ab5bd54fadd8fc9c542b48c99a117a4e182669b
HDL_ON/DAL/DriverLayer/Control.cs
@@ -407,9 +407,12 @@
            switch (function.spk)
            {
                case SPK.ElectricTuyaAirCleaner:
                case SPK.ElectricTuyaAirCleaner2:
                case SPK.ElectricTuyaFan:
                case SPK.ElectricTuyaFan2:
                case SPK.ElectricTuyaWaterValve:
                case SPK.ElectricTuyaWeepRobot:
                case SPK.ElectricTuyaWeepRobot2:
                    useRemote = true;
                    break;
            }
@@ -615,9 +618,9 @@
                        {
                            id = Ins.msg_id.ToString(),
                            objects = new List<Dictionary<string, string>>()
                        {
                            readKey
                        },
                                        {
                                            readKey
                                        },
                            time_stamp = Utlis.GetTimestamp()
                        };
                        var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(readDataObj);
@@ -859,7 +862,8 @@
                }
                else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" ||
                    receiveObj.Topic == CommunicationTopic.ct.ControlFunctionTopic + "_reply" ||
                    receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus)
                    receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus ||
                    receiveObj.Topic.Contains( CommunicationTopic.ct.GatewayUpSortTopic))
                {
                    //TODO 暂时不传正确的数据上去,如果后面要优化前面这些代码
                    UpdataFunctionStatus(receiveObj.BodyDataString, null);
@@ -957,11 +961,14 @@
                        }
                        //更新界面状态
                        Function localObj = null;
                        switch (localFunction.spk)
                        {
                            case SPK.AirSwitch:
                                AirSwitchPage.UpdataState(localFunction);
                                if(localFunction.GetAttribute(FunctionAttributeKey.Power)!=null)//如果是带电量的空开也要更新能源界面
                                {
                                    EnergyMainPage.UpdataStatus(localFunction);
                                }
                                break;
                            case SPK.ElectricEnergy:
                                EnergyMainPage.UpdataStatus(localFunction);
@@ -975,6 +982,7 @@
                                DimmerPage.UpdataStates(localFunction);
                                break;
                            case SPK.ElectricFan:
                            case SPK.HvacFan:
                                localFunction.lastState = Language.StringByID(StringId.Level) + " : " +
                                   localFunction.GetAttrState(FunctionAttributeKey.OpenLevel);
                                FanPage.UpdataState(localFunction);
@@ -1004,6 +1012,8 @@
                            case SPK.CurtainShades:
                                break;
                            case SPK.AcStandard:
                            case SPK.HvacAC:
                            case SPK.AcIr:
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);
                                if (localFunction != null)
                                {
@@ -1042,9 +1052,10 @@
                                            break;
                                    }
                                    localFunction.lastState += " " + localFunction.GetAttrState(FunctionAttributeKey.SetTemp) + new AC().GetTempUnitString(localFunction);
                                    ACPage.UpdataStates(localFunction);
                                }
                                break;
                            case SPK.HvacFloorHeat:
                            case SPK.FloorHeatStandard:
                                localFunction.lastState = "";
                                switch (localFunction.GetAttrState(FunctionAttributeKey.Mode))
@@ -1073,6 +1084,7 @@
                            case SPK.SensorTVOC:
                            case SPK.SensorTemperature:
                            case SPK.SensorHumidity:
                            case SPK.SensorHcho:
                                if(localFunction.spk == SPK.SensorTemperature)
                                {
                                    HomePage.LoadEvent_RefreshEnvirIndoorTemp();
@@ -1082,7 +1094,7 @@
                                    HomePage.LoadEvent_RefreshEnvirIndoorHumi();
                                }
                                EnvironmentalPage.LoadEvent_UpdataStatus(localFunction);
                                A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction);
                                //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction);
                                break;
                            case SPK.SensorEnvironment:
                            case SPK.SensorEnvironment2:
@@ -1096,25 +1108,32 @@
                                    HomePage.LoadEvent_RefreshEnvirIndoorHumi();
                                }
                                EnvironmentalPage.LoadEvent_UpdataStatus(localFunction);
                                A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction);
                                //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction);
                                break;
                            case SPK.ElectricSocket:
                            case SPK.PanelSocket:
                                SocketPage.UpdataState(localFunction);
                                break;
                            case SPK.ElectricTV:
                                break;
                            case SPK.ElectricTuyaAirCleaner:
                            case SPK.ElectricTuyaAirCleaner2:
                            case SPK.ElectricTuyaFan:
                            case SPK.ElectricTuyaFan2:
                            case SPK.ElectricTuyaWeepRobot:
                            case SPK.ElectricTuyaWeepRobot2:
                            case SPK.ElectricTuyaWaterValve:
                            case SPK.ElectricTuyaWaterValve2:
                            case SPK.SensorPir:
                            case SPK.SensorDoorWindow:
                            case SPK.SensorSmoke:
                            case SPK.SensorWater:
                            case SPK.ClothesHanger:
                            case SPK.AcIr:
                            case SPK.SenesorMegahealth:
                            case SPK.SenesorMegahealth2:
                            case SPK.AirFreshStandard:
                            case SPK.HvacAirFresh:
                            case SPK.SensorGas:
                                //设备状态推送
                                //状态更新
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status);