| | |
| | | public class Control |
| | | { |
| | | |
| | | |
| | | static Control _control; |
| | | public static Control Ins |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 安防控制 |
| | | /// </summary> |
| | | public void ControlArm() |
| | | { |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //var pack = httpServer.GetSecurityAlarmLogList |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 发送命令 |
| | |
| | | //远程通讯 |
| | | else |
| | | { |
| | | //Bug修复:一端口远程控制调光设备的调光属性时,无法控制到0,反复横跳。 |
| | | //因为On + 远程控制发送给云端使用的是link协议数据,杨涛中转给高胜处理时候逻辑上有冲突,导致无法单独控制亮度值,需要同时发送开关值与亮度值。 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (commandDictionary.Count == 1) |
| | | { |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on"); |
| | | } |
| | | } |
| | | if(function.spk == SPK.LightCCT) |
| | | { |
| | | if (!commandDictionary.ContainsKey(FunctionAttributeKey.CCT)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.CCT, function.GetAttrState(FunctionAttributeKey.CCT)); |
| | | } |
| | | } |
| | | } |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | var apiControlData = function.GetApiControlData(commandDictionary); |
| | |
| | | //} |
| | | receiveObj.BodyDataString = res[1]; |
| | | |
| | | if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply) |
| | | if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply || receiveObj.Topic == CommunicationTopic.GatewayBroadcast) |
| | | { |
| | | |
| | | var bodyJObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(res[1]); |
| | | if (bodyJObj == null) |
| | | { |
| | |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | if (localFunction.GetAttributes().Contains(FunctionAttributeKey.Temperature)) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | | } |
| | | if (localFunction.GetAttributes().Contains(FunctionAttributeKey.Humidity)) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | | break; |