wjc
2022-12-07 b8c54a7e4048317fc0f33c63a802d60396f82eb0
HDL_ON/Entity/Function/Function.cs
@@ -109,13 +109,13 @@
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string GetAttrState(string key)
        public string GetAttrState(string key , string defaultValue = "0")
        {
            //一级查询keyValue值
            var attrState = attributes.Find((s) => s.key == key.ToString());
            if (attrState == null)
            {
                return "0";
                return defaultValue;
            }
            if (string.IsNullOrEmpty(attrState.state))
            {
@@ -273,6 +273,10 @@
        /// </summary>
        public string deviceId = "0";
        /// <summary>
        /// 第三方设备扩展id
        /// </summary>
        public string extDevId = string.Empty;
        /// <summary>
        /// 设备spk
        /// </summary>
        public string spk = "";
@@ -400,16 +404,20 @@
        /// 是否收藏
        /// </summary>
        public bool collect = false;
        private bool _online = false;
        /// <summary>
        /// 是否在线
        /// </summary>
        public bool online {
        public bool online
        {
            get
            {
                return true;
            }
            set {
            set
            {
                _online = value;
            }
        }
@@ -745,6 +753,7 @@
                    case FunctionAttributeKey.CCT:
                    case FunctionAttributeKey.RGB:
                    case FunctionAttributeKey.Angle:
                    case "security":
                        //case FunctionAttributeKey.FadeTime:
                        if (attr.curValue.ToString() == "{}")
                        {
@@ -769,6 +778,10 @@
                                        attr.curValue = "day";
                                    }
                                }
                            }
                            else if(attr.key == "security")
                            {
                                attr.curValue = "false";
                            }
                            else
                            {
@@ -998,6 +1011,10 @@
    {
        public const string _null = "";
        /// <summary>
        /// 安防布防状态
        /// </summary>
        public const string Security = "security";
        /// <summary>
        /// 开关
        /// </summary>
        public const string OnOff = "on_off";
@@ -1009,6 +1026,7 @@
        /// 颜色
        /// </summary>
        public const string RGB = "rgb";
        public const string RGBW = "rgbw";
        /// <summary>
        /// 渐变时间
        /// </summary>
@@ -1316,6 +1334,24 @@
        /// 通用开关
        /// </summary>
        public const string OtherCommon = "other.common";
        /// <summary>
        /// 大华摄像头
        /// </summary>
        public const string IpCam_Imou = "security.ipcam.imou";
        /// <summary>
        /// 机械手
        /// </summary>
        public const string MechanicalArm = "electrical.mechanical_arm";
        /// <summary>
        /// 空调科技系统(绿建)
        /// 总控
        /// </summary>
        public const string AcstParent = "acst.parent";
        /// <summary>
        /// 空调科技系统(绿建)
        /// 子控
        /// </summary>
        public const string AcstSub = "acst.sub";
        /// <summary>
        /// 门锁
@@ -1331,6 +1367,7 @@
            list.Add(DoorLock);
            return list;
        }
        #region 灯光
@@ -1500,6 +1537,10 @@
        #region 能源
        /// <summary>
        /// 逆变器
        /// </summary>
        public const string Inverter = "energy.inverter";
        /// <summary>
        /// 能源模块
        /// </summary>
        public const string EnergyStandard = "energy.standard";
@@ -1593,6 +1634,10 @@
        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";
@@ -1617,6 +1662,7 @@
            spkList.Add(SensorDryContact2);
            spkList.Add(SenesorMegahealth);
            spkList.Add(SenesorMegahealth2);
            spkList.Add(SensorMmvPose);
            return spkList;
        }
        #endregion
@@ -1635,6 +1681,10 @@
        }
        #region 环境传感器
        /// <summary>
        /// (PM10传感器)
        /// </summary>
        public const string SensorPm10 = "sensor.pm10";
        /// <summary>
        /// (温度传感器)
        /// </summary>
@@ -1684,6 +1734,7 @@
        {
            var spkList = new List<string>();
            spkList.Add(SensorTemperature);
            spkList.Add(SensorPm10);
            spkList.Add(SensorPm25);
            spkList.Add(SensorCO2);
            spkList.Add(SensorTVOC);
@@ -1702,6 +1753,7 @@
        {
            var spkList = new List<string>();
            spkList.Add(SensorTemperature);
            spkList.Add(SensorPm10);
            spkList.Add(SensorPm25);
            spkList.Add(SensorCO2);
            spkList.Add(SensorTVOC);
@@ -1865,6 +1917,13 @@
        }
        #endregion
        #region 可视对讲
        /// <summary>
        /// HDL可视对讲
        /// </summary>
        public const string doorgate="door.gate";
        #endregion
        #region 第三方spk列表
        /// <summary>
        /// 获取所有第三方品牌功能的spk
@@ -1881,6 +1940,7 @@
            spkList.Add(ElectricTuyaWaterValve2);
            spkList.Add(ElectricTuyaWeepRobot);
            spkList.Add(ElectricTuyaWeepRobot2);
            spkList.Add(SensorMmvPose);
            spkList.Add(SenesorMegahealth);
            spkList.Add(SenesorMegahealth2);
            return spkList;
@@ -1906,7 +1966,7 @@
                    list.Add(ElectricTuyaWeepRobot2);
                    break;
                case BrandType.All3tyBrand:
                    list.Add(SenesorMegahealth);//兆观
                    list.Add(SenesorMegahealth2);//兆观
                    break;
            }
            return list;