| | |
| | | var sFunc = new SceneFunction(); |
| | | foreach (var attr in attributes) |
| | | { |
| | | //窗帘同时发送开关跟百分比会有问题, |
| | | if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex) |
| | | { |
| | | 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> |
| | |
| | | /// </summary> |
| | | public const string Inverter = "energy.inverter"; |
| | | /// <summary> |
| | | /// 三相逆变器 |
| | | /// </summary> |
| | | public const string InverterRst = "energy.inverter_rst"; |
| | | /// <summary> |
| | | /// 能源模块 |
| | | /// </summary> |
| | | public const string EnergyStandard = "energy.standard"; |
| | |
| | | |
| | | #region 环境传感器 |
| | | /// <summary> |
| | | /// (PM10传感器) |
| | | /// </summary> |
| | | public const string SensorPm10 = "sensor.pm10"; |
| | | /// <summary> |
| | | /// (温度传感器) |
| | | /// </summary> |
| | | public const string SensorTemperature = "sensor.temperature"; |
| | |
| | | { |
| | | 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; |