| | |
| | | /// </summary> |
| | | public string deviceId = "0"; |
| | | /// <summary> |
| | | /// 第三方设备扩展id |
| | | /// </summary> |
| | | public string extDevId = string.Empty; |
| | | /// <summary> |
| | | /// 物理设备(模块)型号 |
| | | /// </summary> |
| | | public string omodel =string.Empty; |
| | | /// <summary> |
| | | /// 设备spk |
| | | /// </summary> |
| | | public string spk = ""; |
| | |
| | | SetAttrState(sta.key, sta.value); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 功能列表排序 |
| | | /// </summary> |
| | | public int FunctionOrderNumber = 9999; |
| | | /// <summary> |
| | | /// 房间列表排序 |
| | | /// </summary> |
| | | public int RoomOrderNumber = 9999; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (collect) |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code; |
| | | if (spk == SPK.GroupControl) { |
| | | var groupControl = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); |
| | | if (collect) |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CollectGroupControl(groupControl.userDeviceGroupControlId).Code; |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectGroupControl(groupControl.userDeviceGroupControlId).Code; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; |
| | | if (collect) |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code; |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; |
| | | } |
| | | } |
| | | //提示错误 |
| | | if (result != StateCode.SUCCESS) |
| | |
| | | var sFunc = new SceneFunction(); |
| | | foreach (var attr in attributes) |
| | | { |
| | | //窗帘同时发送开关跟百分比会有问题, |
| | | if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream) |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | if (attributes.Find((obj) => obj.key == FunctionAttributeKey.Percent) != null) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | |
| | | switch (attr.key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | |
| | | case FunctionAttributeKey.CCT: |
| | | case FunctionAttributeKey.RGB: |
| | | case FunctionAttributeKey.Angle: |
| | | case "security": |
| | | //case FunctionAttributeKey.FadeTime: |
| | | if (attr.curValue.ToString() == "{}") |
| | | { |
| | |
| | | attr.curValue = "day"; |
| | | } |
| | | } |
| | | } |
| | | else if(attr.key == "security") |
| | | { |
| | | attr.curValue = "false"; |
| | | } |
| | | else |
| | | { |
| | |
| | | /// </summary> |
| | | public List<string> value = new List<string>(); |
| | | /// <summary> |
| | | /// 步进 |
| | | /// 空调温度控制 0.5 1 |
| | | /// </summary> |
| | | public string step = "1"; |
| | | /// <summary> |
| | | /// 最大值 |
| | | /// </summary> |
| | | public int max = 100; |
| | |
| | | public static class FunctionAttributeKey |
| | | { |
| | | public const string _null = ""; |
| | | /// <summary> |
| | | /// 安防布防状态 |
| | | /// </summary> |
| | | public const string Security = "security"; |
| | | /// <summary> |
| | | /// 开关 |
| | | /// </summary> |
| | |
| | | public static class SPK |
| | | { |
| | | /// <summary> |
| | | /// 群控(自定义) |
| | | /// </summary> |
| | | public const string GroupControl = "GroupControl"; |
| | | /// <summary> |
| | | /// 通用开关 |
| | | /// </summary> |
| | | public const string OtherCommon = "other.common"; |
| | | /// <summary> |
| | | /// 大华摄像头 |
| | | /// </summary> |
| | | public const string IpCam_Imou = "security.ipcam.imou"; |
| | | /// <summary> |
| | | /// 机械手 |
| | | /// </summary> |
| | |
| | | /// 门锁 |
| | | /// </summary> |
| | | public const string DoorLock = "security.door"; |
| | | |
| | | /// <summary> |
| | | /// 门锁spk列表 |
| | | /// </summary> |
| | |
| | | list.Add(DoorLock); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 猫眼 |
| | | /// </summary> |
| | | public const string Peephole = "peephole"; |
| | | /// <summary> |
| | | /// 萤石视频门锁 |
| | | /// </summary> |
| | | public const string VideoDoorLock="security.door.ezviz"; |
| | | /// <summary> |
| | | /// 萤石摄像头 |
| | | /// </summary> |
| | | public const string Ev_Ipcam = "security.ipcam.ez"; |
| | | /// <summary> |
| | | /// 萤石视频门锁spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> GetVideoDoorLockSPKList() |
| | | { |
| | | var list = new List<string>(); |
| | | list.Add(VideoDoorLock); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 萤石摄像头spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> GetEvIpcamSPKList() |
| | | { |
| | | var list = new List<string>(); |
| | | list.Add(Ev_Ipcam); |
| | | return list; |
| | | } |
| | | |
| | | #region 灯光 |
| | | /// <summary> |
| | |
| | | public const string HvacAC = "hvac.ac"; |
| | | /// <summary> |
| | | /// 毛细管空调 |
| | | /// </summary> |
| | | /// </summaryc |
| | | public const string HvacCac = "hvac.cac"; |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public const string Inverter = "energy.inverter"; |
| | | /// <summary> |
| | | /// 三相逆变器 |
| | | /// </summary> |
| | | public const string InverterRst = "energy.inverter_rst"; |
| | | /// <summary> |
| | | /// 能源模块 |
| | | /// </summary> |
| | | public const string EnergyStandard = "energy.standard"; |
| | |
| | | /// </summary> |
| | | public const string SensorPir = "sensor.pir"; |
| | | /// <summary> |
| | | /// 人体存在传感器 |
| | | /// </summary> |
| | | public const string SensorPirHold = "sensor.pir_hold"; |
| | | /// <summary> |
| | | /// (门窗传感器) |
| | | /// </summary> |
| | | public const string SensorDoorWindow = "sensor.doorwindow"; |
| | |
| | | public const string SenesorMegahealth = "sensor.megahealth"; |
| | | public const string SenesorMegahealth2 = "sensor.megahealth.zg"; |
| | | /// <summary> |
| | | /// 毫米波传感器(姿态版) |
| | | /// </summary> |
| | | public const string SensorMmvPose = "sensor.mmv_pose"; |
| | | /// <summary> |
| | | /// 紧急呼叫 |
| | | /// </summary> |
| | | public const string SensorHelp = "sensor.help"; |
| | |
| | | var spkList = new List<string>(); |
| | | //spkList.Add(SensorLight); |
| | | spkList.Add(SensorPir); |
| | | spkList.Add(SensorPirHold); |
| | | spkList.Add(SensorHelp); |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | |
| | | spkList.Add(SensorDryContact2); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | spkList.Add(SensorMmvPose); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | |
| | | #region 环境传感器 |
| | | /// <summary> |
| | | /// (PM10传感器) |
| | | /// </summary> |
| | | public const string SensorPm10 = "sensor.pm10"; |
| | | /// <summary> |
| | | /// (温度传感器) |
| | | /// </summary> |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorTemperature); |
| | | spkList.Add(SensorPm10); |
| | | spkList.Add(SensorPm25); |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment); spkList.Add(SensorEnvironmentHailin); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | spkList.Add(SensorHcho); |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorTemperature); |
| | | spkList.Add(SensorPm10); |
| | | spkList.Add(SensorPm25); |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | |
| | | public static List<string> EvironmentSensorList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment); spkList.Add(SensorEnvironmentHailin); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | return spkList; |
| | |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWeepRobot2); |
| | | spkList.Add(SensorMmvPose); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | return spkList; |
| | |
| | | list.Add(ElectricTuyaWeepRobot2); |
| | | break; |
| | | case BrandType.All3tyBrand: |
| | | list.Add(SenesorMegahealth);//兆观 |
| | | list.Add(SenesorMegahealth2);//兆观 |
| | | break; |
| | | } |
| | | return list; |